Skip to content

Commit

Permalink
asdfa
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingface0 committed Sep 6, 2023
1 parent 893de6a commit e741cd1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions tests/test_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def testing_database():
]


def test_db_1(testing_database):
def test_db_1(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.get_latest_revision()")
revs = [
6001382,
Expand All @@ -111,7 +111,7 @@ def test_db_1(testing_database):
)


def test_db_2(testing_database):
def test_db_2(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.get_runs_around()")
test_runs = [358788, 358791, 358792]
truth_answers = [
Expand All @@ -130,7 +130,7 @@ def test_db_2(testing_database):
assert all(answers)


def test_db_3(testing_database):
def test_db_3(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.get_logs()")
test_ids = [
"dqm-source-state-run358788-hostfu-c2f11-11-04-pid041551",
Expand All @@ -153,21 +153,21 @@ def test_db_3(testing_database):
assert logs[0] == truth and logs[1] == truth


def test_db_4(testing_database):
def test_db_4(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.get_info()")
minmax = testing_database.get_info()
assert minmax[0] == 358788 and minmax[1] == 358792


def test_db_5(testing_database):
def test_db_5(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.update_min_max() & DQM2MirrorDB.get_info()")
testing_database.update_min_max(350000, 360000)
minmax = testing_database.get_info()
print(minmax)
assert minmax[0] == 350000 and minmax[1] == 360000


def test_db_6(testing_database):
def test_db_6(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.get_clients()")
clients_truth = [
"beam",
Expand Down Expand Up @@ -207,22 +207,23 @@ def test_db_6(testing_database):
assert all([c1 == c2 for c1, c2 in zip(clients, clients_truth)])


def test_db_7(testing_database):
def test_db_7(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.get_timeline_data()")
truth = TEST_DB_7_TRUTH
answer = json.dumps(testing_database.get_timeline_data(358791, 358791))
print("ANSWER\n\n", answer)
assert truth == answer


def test_db_8(testing_database):
def test_db_8(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.get_mirror_data()")
truth = "''''(),11112223333333334445566899999________ccimnorsu" # Literally WTF
answer = testing_database.get_mirror_data(358788)[0]
answer = ("".join(sorted(str(answer)))).strip()
assert truth == answer


def test_db_9(testing_database):
def test_db_9(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.get_graphs_data()")
truth = TEST_DB_9_TRUTH
answer = testing_database.get_graphs_data(358792)
Expand All @@ -237,7 +238,7 @@ def test_db_9(testing_database):
assert item == answer[i]


def test_db_10(testing_database):
def test_db_10(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.fill_graph()")
truth = [
123456,
Expand All @@ -255,7 +256,7 @@ def test_db_10(testing_database):
assert all([c1 == c2 for c1, c2 in zip(truth, answer)])


def test_db_11(testing_database):
def test_db_11(testing_database: DQM2MirrorDB):
print("Check DQM2MirrorDB.fill_run() & get()")
truth = (
"id",
Expand Down

0 comments on commit e741cd1

Please sign in to comment.