Commit c6d69c93 authored by Bogdan's avatar Bogdan

Adjusted Repository

parent cd5c2e2d
...@@ -44,8 +44,13 @@ class Repository(MongoRepositoryBase): ...@@ -44,8 +44,13 @@ class Repository(MongoRepositoryBase):
def get_transaction_with_id(self, unique_id: str) -> Transaction: def get_transaction_with_id(self, unique_id: str) -> Transaction:
result = list(super().get_entries(self._transaction_collection, projection={'_id': False}, selection={"UniqueID": unique_id})) result = list(super().get_entries(self._transaction_collection, projection={'_id': False}, selection={"UniqueID": unique_id}))
return None
if len(result) >= 1: if len(result) >= 1:
return Transaction.from_serializable_dict(result) returnList = []
for item in result:
returnList.append(item)
return Transaction.from_serializable_dict(returnList)
return None return None
......
...@@ -199,6 +199,7 @@ class Test_MessageHandler(unittest.TestCase): ...@@ -199,6 +199,7 @@ class Test_MessageHandler(unittest.TestCase):
self.assertEqual(len(self.repo.added_transactions),2) self.assertEqual(len(self.repo.added_transactions),2)
def test_handleBlockchainTransaction_multipleTransactions_3AddedUnique2Duplicate(self): def test_handleBlockchainTransaction_multipleTransactions_3AddedUnique2Duplicate(self):
print("Entered Test: 3Unique 2Dupli")
msg = self._get_valid_message() msg = self._get_valid_message()
msg2 = self._get_valid_message2() msg2 = self._get_valid_message2()
msg3 = self._get_valid_message3() msg3 = self._get_valid_message3()
......
...@@ -57,7 +57,7 @@ if __name__ == '__main__': ...@@ -57,7 +57,7 @@ if __name__ == '__main__':
"ApplicationType": "debug", "ApplicationType": "debug",
"docType": "pizza", "docType": "pizza",
"id": 1, "id": 1,
"name": "MEXICAANA", "name": "Quatro Formagi",
"dough": { "dough": {
"type": "wheat", "type": "wheat",
"spinach": False "spinach": False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment