Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add additional query tests #174

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion h5pyd/_hl/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def libver(self):
return ("0.0.1",)

@property
def serverver(self):
def server_ver(self):
return self._version

@property
Expand Down
5 changes: 3 additions & 2 deletions test/hl/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ def test_create(self):
self.assertTrue(f.modified >= f.created)

self.assertTrue(len(f.owner) > 0)
version = f.serverver
# server version should be of form "n.n.n"

version = f.server_ver

n = version.find(".")
self.assertTrue(n >= 1)
limits = f.limits
Expand Down
12 changes: 12 additions & 0 deletions test/hl/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ def test_query_table(self):
self.assertTrue(quote[3] > 3000)
self.assertTrue(quote[3] < 3100)


# try where in list query
if f.server_ver.startswith("0.9"):
condition = "where symbol in (b'AAPL', b'EBAY')"
quotes = table.read_where(condition)
self.assertEqual(len(quotes), 8)
for i in range(8):
quote = quotes[i]
self.assertTrue(quote[1] in (b'AAPL', b'EBAY'))
else:
print("'where in' queries require HSDS version 0.9 or higher")

# try modifying specific rows
condition = "symbol == b'AAPL'"
update_val = {"open": 123}
Expand Down
Loading