Skip to content

Commit

Permalink
Fixed - Collection is getting deleted even after it is attached to pr…
Browse files Browse the repository at this point in the history
…ompt action.

1. Added unit and integration test cases.
2. Fixed test cases.
  • Loading branch information
Nupur Khare committed Nov 1, 2023
1 parent 4219401 commit d5efff6
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions tests/integration_test/services_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,6 @@ def _mock_get_bot_settings(*args, **kwargs):
headers={"Authorization": pytest.token_type + " " + pytest.access_token}
)
actual = response.json()
print(actual)
pytest.schema_id = actual["data"]["_id"]
assert actual["message"] == "Schema saved!"
assert actual["data"]["_id"]
Expand All @@ -1277,7 +1276,6 @@ def _mock_get_bot_settings(*args, **kwargs):
headers={"Authorization": pytest.token_type + " " + pytest.access_token}
)
actual_schema = response_schema.json()
print(actual_schema)
assert actual_schema["data"][0]['collection_name'] == 'details'
assert actual_schema["data"][0]['metadata'][0] == {'column_name': 'details', 'data_type': 'str', 'enable_search': True, 'create_embeddings': True}
assert actual_schema["error_code"] == 0
Expand All @@ -1301,7 +1299,6 @@ def _mock_get_bot_settings(*args, **kwargs):
headers={"Authorization": pytest.token_type + " " + pytest.access_token}
)
actual_payload = response_payload.json()
print(actual_payload)
assert actual_payload["success"]
assert actual_payload["message"] is None
assert actual_payload["error_code"] == 0
Expand All @@ -1319,7 +1316,6 @@ def _mock_get_bot_settings(*args, **kwargs):
headers={"Authorization": pytest.token_type + " " + pytest.access_token}
)
actual_one = response_one.json()
print(actual_one)
pytest.schema_id_one = actual_one["data"]["_id"]
assert actual_one["message"] == "Schema saved!"
assert actual_one["data"]["_id"]
Expand All @@ -1335,7 +1331,6 @@ def _mock_get_bot_settings(*args, **kwargs):
headers={"Authorization": pytest.token_type + " " + pytest.access_token}
)
actual_two = response_two.json()
print(actual_two)
pytest.schema_id_two = actual_two["data"]["_id"]
assert actual_two["message"] == "Schema saved!"
assert actual_two["data"]["_id"]
Expand Down Expand Up @@ -1380,7 +1375,6 @@ def _mock_get_bot_settings(*args, **kwargs):
headers={"Authorization": pytest.token_type + " " + pytest.access_token}
)
actual_four = response_four.json()
print(actual)
assert not actual_four["success"]
assert actual_four["message"] == "Collection already exists!"
assert actual_four["data"] is None
Expand Down

0 comments on commit d5efff6

Please sign in to comment.