Skip to content

Commit

Permalink
ISSUE #78
Browse files Browse the repository at this point in the history
  • Loading branch information
vladyslav-fenchak committed Feb 10, 2022
1 parent bbebed9 commit 791cd39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions minos/api_gateway/discovery/domain/microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,10 @@ async def save(self, db_client) -> None:
}

microservice_key = f"{MICROSERVICE_KEY_PREFIX}:{self.name}"
log.info("--------SAVE----------")
log.info("--------DATA TO SAVE----------")
log.info(microservice_key)
log.info(microservice_value)
res = await db_client.set_data(microservice_key, microservice_value)
log.info("REDIS RES")
log.info(res)
await db_client.set_data(microservice_key, microservice_value)
for endpoint_key in microservice_value["endpoints"]:
await db_client.set_data(endpoint_key, microservice_key)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def test_redis_client_get_data(self):

async def test_redis_client_set_data(self):
response = await self.redis_client.set_data("endpoint_name", {"test": "a"})
self.assertTrue(response)
self.assertIsNone(response)

async def test_redis_client_delete_unexisting_data(self):
response = await self.redis_client.delete_data("nokey")
Expand All @@ -63,7 +63,7 @@ async def test_redis_client_delete_data(self):
async def test_redis_client_update_data(self):
d = {"test": "a"}
res1 = await self.redis_client.set_data("update_example", d)
self.assertTrue(res1)
self.assertIsNone(res1)
await self.redis_client.set_data("update_example", {"test": "b"})
data = await self.redis_client.get_data("update_example")
self.assertDictEqual({"test": "b"}, data)
Expand Down

0 comments on commit 791cd39

Please sign in to comment.