Skip to content

Commit

Permalink
Add test for noPhotos
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardo-rodrigues committed Nov 17, 2023
1 parent c4740a7 commit 52a51ca
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/dec/test_dec.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,33 @@ def test_list_lineshapePW_definitions():


def test_global_photos_flag():
"""
Check that PHOTOS is on for all decays.
"""
p = DecFileParser(DIR / "../data/defs-aliases-chargeconj.dec")
p.parse()

assert p.global_photos_flag()


def test_global_photos_off():
"""
Check that PHOTOS is off for all decays.
"""
s = """
# Turn off PHOTOS for all decays
noPhotos
Decay D0
1.0 K- pi+ PHSP;
Enddecay
"""
p = DecFileParser.from_string(s)
p.parse()

assert p.global_photos_flag() == PhotosEnum.no


def test_missing_global_photos_flag():
p = DecFileParser(DIR / "../data/test_example_Dst.dec")
p.parse()
Expand All @@ -312,6 +333,7 @@ def test_duplicated_global_photos_flag():
"""
p = DecFileParser.from_string(s)
p.parse()

# The following call issues the warning
# UserWarning: PHOTOS flag re-set! Using flag set in last ...
# warnings.warn("PHOTOS flag re-set! Using flag set in last ...")
Expand Down

0 comments on commit 52a51ca

Please sign in to comment.