mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 13:59:31 -06:00
Make hypos tuples again 😥
This commit is contained in:
@@ -113,10 +113,13 @@ def test_categoryContext_3(PGF):
|
||||
cxt = PGF.categoryContext("P")
|
||||
assert len(cxt) == 1
|
||||
hypo = cxt[0]
|
||||
assert isinstance(hypo, Hypo)
|
||||
assert hypo.bind_type == BIND_TYPE_EXPLICIT
|
||||
assert hypo.cid == "_"
|
||||
assert hypo.type == readType("N")
|
||||
# assert isinstance(hypo, Hypo)
|
||||
# assert hypo.bind_type == BIND_TYPE_EXPLICIT
|
||||
# assert hypo.cid == "_"
|
||||
# assert hypo.type == readType("N")
|
||||
assert hypo[0] == BIND_TYPE_EXPLICIT
|
||||
assert hypo[1] == "_"
|
||||
assert hypo[2] == readType("N")
|
||||
|
||||
def test_categoryContext_4(PGF):
|
||||
assert PGF.categoryContext("X") == None
|
||||
|
||||
@@ -15,7 +15,7 @@ def gr2(gr1):
|
||||
gr = gr1
|
||||
t = gr.newTransaction()
|
||||
t.createFunction("foo", ty, 0, prob)
|
||||
t.createCategory("Q", [Hypo(BIND_TYPE_EXPLICIT, "x", ty)], prob)
|
||||
t.createCategory("Q", [(BIND_TYPE_EXPLICIT, "x", ty)], prob)
|
||||
t.commit()
|
||||
yield gr
|
||||
|
||||
@@ -24,7 +24,7 @@ def gr3(gr1):
|
||||
gr = gr1
|
||||
with gr.newTransaction("bar_branch") as t:
|
||||
t.createFunction("bar", ty, 0, prob)
|
||||
t.createCategory("R", [Hypo(BIND_TYPE_EXPLICIT, "x", ty)], prob)
|
||||
t.createCategory("R", [(BIND_TYPE_EXPLICIT, "x", ty)], prob)
|
||||
yield gr
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@@ -89,7 +89,7 @@ def test_extended_categories(gr2):
|
||||
assert gr2.categories == ["Float","Int","N","P","Q","S","String"]
|
||||
|
||||
def test_extended_category_context(gr2):
|
||||
assert gr2.categoryContext("Q") == [Hypo(BIND_TYPE_EXPLICIT, "x", ty)]
|
||||
assert gr2.categoryContext("Q") == [(BIND_TYPE_EXPLICIT, "x", ty)]
|
||||
|
||||
def test_extended_function_type(gr2):
|
||||
assert gr2.functionType("foo") == ty
|
||||
@@ -112,7 +112,7 @@ def test_branched_categories(gr3):
|
||||
assert gr3.categories == ["Float","Int","N","P","R","S","String"]
|
||||
|
||||
def test_branched_category_context(gr3):
|
||||
assert gr3.categoryContext("R") == [Hypo(BIND_TYPE_EXPLICIT, "x", ty)]
|
||||
assert gr3.categoryContext("R") == [(BIND_TYPE_EXPLICIT, "x", ty)]
|
||||
|
||||
def test_branched_function_type(gr3):
|
||||
assert gr3.functionType("bar") == ty
|
||||
|
||||
Reference in New Issue
Block a user