Skip to content

Commit

Permalink
Making the tests more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwatts committed Mar 4, 2024
1 parent 08456fb commit 62a4c5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions tests/atlas/xaod/test_enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_enum_return():
lines = get_lines_of_code(r)
print_lines(lines)

found_lines = find_line_numbers_with("i_obj1->color()==xAOD::Jet::Red", lines)
found_lines = find_line_numbers_with("->color()==xAOD::Jet::Red", lines)
assert len(found_lines) == 1


Expand All @@ -75,7 +75,7 @@ def test_enum_arg():
lines = get_lines_of_code(r)
print_lines(lines)

found_lines = find_line_numbers_with("i_obj1->color(xAOD::Jet::Red)==true", lines)
found_lines = find_line_numbers_with("->color(xAOD::Jet::Red)==true", lines)
assert len(found_lines) == 1


Expand All @@ -98,3 +98,10 @@ def test_enum_output():
print_lines(lines)

assert False, "Not implemented"


def test_enum_from_other_class():
"""Check to make sure an enum passed as an argument to one class
is properly included (e.g. the include files are there!).
"""
assert False, "Not implemented"
4 changes: 2 additions & 2 deletions tests/common/test_cpp_representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ def test_member_access_obj_depth_1():

def test_ns_scope():
"The NS scope is always top level - defined everywhere"
cr = crep.cpp_namespace(ctyp.NameSpaceInfo("bogus"))
cr = crep.cpp_namespace(ctyp.NameSpaceInfo("bogus", None))
assert cr.scope().is_top_level()


def test_ns_str():
"NS should be readable"
cr = crep.cpp_namespace(ctyp.NameSpaceInfo("bogus"))
cr = crep.cpp_namespace(ctyp.NameSpaceInfo("bogus", None))
assert str(cr) == "cpp_namespace(bogus)"

0 comments on commit 62a4c5a

Please sign in to comment.