def test_iter_dirs(scendir): paths = { "default": [True, False], "default_with_confpy": [True, True], "just_confpy": [False, True], } for path, xmls, confpy in iter_scen_dirs(scendir): expect = paths.get(os.path.basename(path), None) if expect: assert [bool(xmls), bool(confpy)] == expect
def test_iter_dirs(scendir): paths = { 'default': [True, False], 'default_with_confpy': [True, True], 'just_confpy': [False, True], } for path, xmls, confpy in iter_scen_dirs(scendir): expect = paths.get(os.path.basename(path), None) if expect: assert [bool(xmls), bool(confpy)] == expect
def test_iter_dirs(scendir): paths = { 'default': [True, False], 'default_with_confpy': [True, True], 'just_confpy': [False, True], } for path, xmls, confpy in iter_scen_dirs(scendir): expect = paths.get(os.path.basename(path), None) if expect: assert map(bool, (xmls, confpy)) == expect
def test_scendir_loading(scendir): dir_list = list(iter_scen_dirs(scendir)) assert len(dir_list) == 2 # only dirs with xmls