Skip to content

Commit

Permalink
Move all test data files to tests/data
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardo-rodrigues committed Apr 5, 2019
1 parent 59a1da2 commit d8c9bb9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions tests/test_dec.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,32 @@ def test_unknown_decfile():

def test_non_parsed_decfile():
with pytest.raises(DecFileNotParsed):
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.list_decay_mother_names()


def test_non_existent_decay():
with pytest.raises(DecayNotFound):
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.parse()
p.list_decay_modes('XYZ')


def test_default_grammar_loading():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')

assert p.grammar is not None


def test_explicit_grammar_loading():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.load_grammar(DIR / '../decaylanguage/data/decfile.lark')

assert p.grammar_loaded is True


def test_string_representation():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')

assert "n_decays" not in p.__str__()

Expand All @@ -60,7 +60,7 @@ def test_string_representation():


def test_simple_dec():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.parse()

assert p.list_decay_mother_names() == ['D*+', 'D*-', 'D0', 'D+', 'pi0']
Expand All @@ -69,7 +69,7 @@ def test_simple_dec():


def test_decay_mode_details():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.parse()

tree_Dp = p._find_decay_modes('D+')[0]
Expand All @@ -78,7 +78,7 @@ def test_decay_mode_details():


def test_build_decay_chain():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.parse()

output = {'D+': [{'bf': 1.0, 'fs': ['K-', 'pi+', 'pi+', 'pi0'], 'm': 'PHSP', 'mp': ''}]}
Expand Down

0 comments on commit d8c9bb9

Please sign in to comment.