Skip to content

Commit

Permalink
remove extra namespace call
Browse files Browse the repository at this point in the history
  • Loading branch information
greenmtnboy committed Jun 19, 2024
1 parent d9bebcb commit 21a7002
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 47 deletions.
2 changes: 1 addition & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def parse_env_from_full_model(input: ModelInSchema) -> Environment:
continue
try:
if source.alias:
new = Environment(namespace=source.alias)
new = Environment()
for k, v in parsed.items():
new.add_import(k, v)
new.parse(source.contents)
Expand Down
46 changes: 0 additions & 46 deletions backend/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,52 +55,6 @@ def test_gen_ai(test_client: TestClient):
assert response.status_code == 403


# def test_async_functions(test_client: TestClient):
# response = test_client.post("/long_sleep", json={"sleep": 1})
# assert response.status_code == 200
# assert response.json().get("slept") == 1

# ## start async test
# response = test_client.post("/async_long_sleep", json={"sleep": 5})
# assert response.status_code == 200

# guid1 = response.json().get("guid")
# assert guid1 is not None

# response = test_client.post("/async_long_sleep", json={"sleep": 5})
# assert response.status_code == 200
# guid2 = response.json().get("guid")
# assert guid2 is not None

# datetime1 = datetime.now()

# found:set[str] = set()
# attempts = 0
# max_attempts = 5
# from time import sleep

# while len(found) < 2:
# attempts += 1
# for guid in (guid1, guid2):
# if guid in found:
# continue
# response = test_client.get(f"/background_tasks/{guid}")
# print(response)
# if response.status_code == 200:
# found.add(guid)
# assert response.json().get("slept") == 5
# break
# elif response.status_code == 102:
# pass
# else:
# raise ValueError(response)
# sleep(1)
# if attempts > max_at,tempts:
# raise ValueError(f"Too many attempts, last response {response}")
# # basic check that they ran async and not 5+5 seconds
# assert (datetime.now() - datetime1).seconds < 7


def test_parse_full():
input = ModelInSchema(
name="test",
Expand Down

0 comments on commit 21a7002

Please sign in to comment.