Commit c6d69c93 authored by Bogdan's avatar Bogdan

Adjusted Repository

parent cd5c2e2d
......@@ -44,8 +44,13 @@ class Repository(MongoRepositoryBase):
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}))
return None
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
......
......@@ -199,6 +199,7 @@ class Test_MessageHandler(unittest.TestCase):
self.assertEqual(len(self.repo.added_transactions),2)
def test_handleBlockchainTransaction_multipleTransactions_3AddedUnique2Duplicate(self):
print("Entered Test: 3Unique 2Dupli")
msg = self._get_valid_message()
msg2 = self._get_valid_message2()
msg3 = self._get_valid_message3()
......
......@@ -57,7 +57,7 @@ if __name__ == '__main__':
"ApplicationType": "debug",
"docType": "pizza",
"id": 1,
"name": "MEXICAANA",
"name": "Quatro Formagi",
"dough": {
"type": "wheat",
"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