-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_raw_sql.py
More file actions
43 lines (28 loc) · 1017 Bytes
/
test_raw_sql.py
File metadata and controls
43 lines (28 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from transpose import Transpose, api_key
from transpose.src.base import TransposeBadRequest
def test_basic():
try:
api = Transpose(api_key)
response = api.sql.query("SELECT * FROM ethereum.logs LIMIT 1;")
assert response['stats']['count'] == 1
assert len(response['results']) == 1
except Exception:
assert False
def test_batch():
try:
api = Transpose(api_key)
response = api.sql.query("SELECT * FROM ethereum.logs LIMIT 100;")
assert response['stats']['count'] == 100
assert len(response['results']) == 100
except Exception:
assert False
def test_invalid_query():
try:
api = Transpose(api_key)
response = api.sql.query("SELECT * FROM ethereum.lgos LIMIT 1;")
# assert throws
assert False
except TransposeBadRequest:
assert True
except Exception:
assert False