Skip to content

Commit

Permalink
Change method for getting expected output if tests are moved
Browse files Browse the repository at this point in the history
  • Loading branch information
H0R5E committed Oct 12, 2021
1 parent a99473d commit f3585c0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tests/test_utilities_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,27 @@ def test_get_module_names_from_package():

assert names == ['logging.config', 'logging.handlers']

def test_get_module_names_from_paths():

def test_get_module_names_from_paths():

'''Test if we can retrieve the root package name from the source code'''

# Get this module path and then the directory above it.
this_mod = sys.modules[__name__]
mod_path = module_path(this_mod)
root_dir = '{}\\..'.format(os.path.dirname(mod_path))
names = get_module_names_from_paths([root_dir])

# Get the expected names by looking for py files in the root_dir
expected = []

for check_file in os.listdir(root_dir):
if check_file.endswith(".py"):
name, _ = os.path.splitext(check_file)
expected.append(name)

assert set(names) >= set(expected)

assert names == ['aneris', 'setup']

def test_get_class_descriptions_from_module():

Expand Down

0 comments on commit f3585c0

Please sign in to comment.