forked from GitHub/gf-core
Un-skip read/boot tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
import pgf
|
import pgf
|
||||||
|
|
||||||
@@ -15,7 +16,6 @@ def test_readPGF_GF():
|
|||||||
with pytest.raises(pgf.PGFError):
|
with pytest.raises(pgf.PGFError):
|
||||||
pgf.readPGF("../haskell/tests/basic.gf")
|
pgf.readPGF("../haskell/tests/basic.gf")
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Unhandled case in runtime")
|
|
||||||
def test_readPGF_NGF(NGF):
|
def test_readPGF_NGF(NGF):
|
||||||
with pytest.raises(pgf.PGFError):
|
with pytest.raises(pgf.PGFError):
|
||||||
pgf.readPGF("./basic.ngf")
|
pgf.readPGF("./basic.ngf")
|
||||||
@@ -24,7 +24,9 @@ def test_readPGF_NGF(NGF):
|
|||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def NGF():
|
def NGF():
|
||||||
return pgf.bootNGF("../haskell/tests/basic.pgf", "./basic.ngf")
|
ngf = pgf.bootNGF("../haskell/tests/basic.pgf", "./basic.ngf")
|
||||||
|
yield ngf
|
||||||
|
os.remove("./basic.ngf")
|
||||||
|
|
||||||
def test_bootNGF_non_existant():
|
def test_bootNGF_non_existant():
|
||||||
with pytest.raises(FileNotFoundError):
|
with pytest.raises(FileNotFoundError):
|
||||||
@@ -34,35 +36,32 @@ def test_bootNGF_GF():
|
|||||||
with pytest.raises(pgf.PGFError):
|
with pytest.raises(pgf.PGFError):
|
||||||
pgf.bootNGF("../haskell/tests/basic.gf", "./abc.ngf")
|
pgf.bootNGF("../haskell/tests/basic.gf", "./abc.ngf")
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Unhandled case in runtime")
|
|
||||||
def test_bootNGF_NGF(NGF):
|
def test_bootNGF_NGF(NGF):
|
||||||
with pytest.raises(pgf.PGFError):
|
with pytest.raises(pgf.PGFError):
|
||||||
pgf.bootNGF("./basic.ngf", "./abc.ngf")
|
pgf.bootNGF("./basic.ngf", "./abc.ngf")
|
||||||
|
|
||||||
def test_bootNGF_existing(NGF):
|
def test_bootNGF_existing(NGF):
|
||||||
with pytest.raises(FileExistsError):
|
with pytest.raises(FileExistsError):
|
||||||
pgf.bootNGF("../haskell/tests/basicp.gf", "./basic.ngf")
|
pgf.bootNGF("../haskell/tests/basic.pgf", "./basic.ngf")
|
||||||
|
|
||||||
# readNGF
|
# readNGF
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Unhandled case in runtime")
|
|
||||||
def test_readNGF_non_existant():
|
def test_readNGF_non_existant():
|
||||||
with pytest.raises(FileNotFoundError):
|
PGF = pgf.readNGF("./abc.ngf") # create empty grammar
|
||||||
pgf.readNGF("./abc.ngf")
|
assert PGF.categories == []
|
||||||
|
os.remove("./abc.ngf") # cleanup
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Unhandled case in runtime")
|
|
||||||
def test_readNGF_GF():
|
def test_readNGF_GF():
|
||||||
with pytest.raises(pgf.PGFError):
|
with pytest.raises(pgf.PGFError):
|
||||||
pgf.readNGF("../haskell/tests/basic.gf")
|
pgf.readNGF("../haskell/tests/basic.gf")
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Unhandled case in runtime")
|
|
||||||
def test_readNGF_PGF():
|
def test_readNGF_PGF():
|
||||||
with pytest.raises(pgf.PGFError):
|
with pytest.raises(pgf.PGFError):
|
||||||
pgf.readNGF("../haskell/tests/basic.pgf")
|
pgf.readNGF("../haskell/tests/basic.pgf")
|
||||||
|
|
||||||
def test_readNGF(NGF):
|
def test_readNGF(NGF):
|
||||||
pgf.readNGF("./basic.ngf")
|
PGF = pgf.readNGF("./basic.ngf")
|
||||||
# TODO assert read actually worked
|
assert len(PGF.categories) > 0
|
||||||
|
|
||||||
# abstract syntax
|
# abstract syntax
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user