Skip to content

Commit

Permalink
improve integration test: add check on values added
Browse files Browse the repository at this point in the history
  • Loading branch information
aless10 committed Jun 11, 2024
1 parent 490fe2f commit 05c75ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
28 changes: 17 additions & 11 deletions integration/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ def test_append_dataset(self):
# This is intended to leave only two records. Changing the variable `datetime_var`
# above also changes the test's results
filter_value = "2024-03-15T00:00:00.393"
resp = scrunch_dataset.append_dataset(
scrunch_dataset_to_append,
filter=f"my_datetime_var > '{filter_value}'"
)
if resp is not None:
resp['body']['filter'] = {
try:
resp = scrunch_dataset.append_dataset(
scrunch_dataset_to_append,
filter=f"my_datetime_var > '{filter_value}'"
)
assert resp['body']['filter'] == {
'args': [
{
'variable': datetime_var['self']
Expand All @@ -106,11 +106,17 @@ def test_append_dataset(self):
],
'function': '>'
}
else:
pass

ds.delete()
ds_to_append.delete()
result = ds.follow("table", "limit=10")['data']
datetime_variable = result[datetime_var.body.id]
non_null_values = [value for value in datetime_variable if isinstance(value, str)]
assert non_null_values == [
"2024-04-03T20:00:52.999",
"2024-06-03T20:00:52.123",
]
finally:
# cleanup
ds.delete()
ds_to_append.delete()


class TestCategories(TestCase):
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
long_description = readme.read()

PY2 = sys.version_info[0] < 3
print("This is py2")

PY36 = sys.version_info[:2] == (3, 6)

Expand Down

0 comments on commit 05c75ff

Please sign in to comment.