Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wshayes committed May 31, 2018
1 parent 557f817 commit 2c5a1c1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions tests/lang/test_canonicalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def test_canon_one():

bo.canonicalize()

print(f"Result {bo.ast.to_string(fmt='long')}")

assert bo.ast.to_string(fmt='long') == expected


Expand Down
4 changes: 2 additions & 2 deletions tests/lang/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def test_completion_complex():
completions = bel.lang.completion.bel_completion('complex(m', bel_fmt='medium')
print('Completions:\n', json.dumps(completions, indent=4))
assert len(completions["completions"]) == 11
assert len(completions["completions"]) == 21


# @pytest.mark.skip(reason="Not finished with this test")
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_completion_arg_ns_val():
completions = bel.lang.completion.bel_completion('complex(p(HGNC:EGFR))', cursor_loc=12, bel_fmt='medium')
print('Completions:\n', json.dumps(completions, indent=4))
assert completions["completion_text"] == "HGN"
assert ["complex(p(HGNC:IDNK))"] == [c["replacement"] for c in completions["completions"] if c['replacement'] == "complex(p(HGNC:IDNK))"]
assert "complex(p(" in completions['completions'][0]['replacement']
assert completions['entity_spans'] != []
assert completions['function_help'] != []

Expand Down
4 changes: 2 additions & 2 deletions tests/lang/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

SPECIFIED_ENDPOINT = 'example-endpoint'

bel_obj = bel.BEL(SPECIFIED_VERSION, SPECIFIED_ENDPOINT)
bel_obj = bel.BEL(version=SPECIFIED_VERSION, api_url=SPECIFIED_ENDPOINT)

######################
# INITIAL TEST CASES #
Expand All @@ -18,4 +18,4 @@

def test_correct_instantiation():
assert bel_obj.version == SPECIFIED_VERSION
assert bel_obj.endpoint == SPECIFIED_ENDPOINT
assert bel_obj.api_url == SPECIFIED_ENDPOINT
2 changes: 1 addition & 1 deletion tests/lang/test_migrate12.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def test_migrate():

# No migration examples
bel1 = 'sec(a(CHEBI:"3-hydroxybutyrate"))'
bel2 = 'sec(a(CHEBI:"3-hydroxybutyrate"))'
bel2 = 'sec(a(CHEBI:3-hydroxybutyrate))'

assert bel.lang.migrate_1_2.migrate(bel1) == bel2

Expand Down
3 changes: 2 additions & 1 deletion tests/lang/test_partialparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ def test_parse():

print(ast.to_string())

assert False
assert ast.to_string() == 'sec(a(CHEBI:3-hydroxybutyrate))'

0 comments on commit 2c5a1c1

Please sign in to comment.