Skip to content

Commit

Permalink
Fixed lifespan test
Browse files Browse the repository at this point in the history
  • Loading branch information
kanesoban committed Dec 11, 2024
1 parent 8d8e93e commit 3207b85
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions swarm_copy_tests/app/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ async def save_dummy(*args, **kwargs):
f.write("test_text")

with (
patch("neuroagent.app.main.get_update_kg_hierarchy", new=save_dummy),
patch("neuroagent.app.main.get_cell_types_kg_hierarchy", new=save_dummy),
patch("neuroagent.app.main.get_kg_token", new=lambda *args, **kwargs: "dev"),
patch("swarm_copy.app.main.get_update_kg_hierarchy", new=save_dummy),
patch("swarm_copy.app.main.get_cell_types_kg_hierarchy", new=save_dummy),
patch("swarm_copy.app.main.get_kg_token", new=lambda *args, **kwargs: "dev"),
):
# The with statement triggers the startup.
with TestClient(app) as test_client:
Expand All @@ -53,12 +53,12 @@ async def save_dummy(*args, **kwargs):
assert save_path_brainregion.exists()

assert caplog.record_tuples[0][::2] == (
"neuroagent.app.dependencies",
"swarm_copy.app.dependencies",
"Reading the environment and instantiating settings",
)

assert (
logging.getLevelName(logging.getLogger("neuroagent").getEffectiveLevel())
logging.getLevelName(logging.getLogger("swarm_copy").getEffectiveLevel())
== "INFO"
)
assert (
Expand Down

0 comments on commit 3207b85

Please sign in to comment.