def test_from_command_options_default(): cfg = Configuration.from_command_options() assert attr.asdict(cfg, recurse=False) == { "select": None, "ignore": None, "toplevel": None, "package_paths": None, "src_dirs": None, "package_omit": None, }
def test_from_command_options_default(): cfg = Configuration.from_command_options() assert cfg.dict() == { "select": None, "ignore": None, "toplevel": None, "package_paths": None, "src_dirs": None, "package_omit": None, }
def test_from_command_options(toplevel_in, toplevel_out, package_in, package_out, src_dir_in, src_dir_out, package_omit_in, package_omit_out): cfg = Configuration.from_command_options( select=sentinel.SELECT, ignore=sentinel.IGNORE, toplevel=toplevel_in, package=package_in, src_dir=src_dir_in, package_omit=package_omit_in, ) assert attr.asdict(cfg, recurse=False) == { "select": sentinel.SELECT, "ignore": sentinel.IGNORE, "toplevel": toplevel_out, "package_paths": package_out, "src_dirs": src_dir_out, "package_omit": package_omit_out, }
def test_from_command_options(toplevel_in, toplevel_out, package_in, package_out, src_dir_in, src_dir_out, package_omit_in, package_omit_out): cfg = Configuration.from_command_options( select={Check.W001, Check.W002}, ignore={Check.W003, Check.W004}, toplevel=toplevel_in, package=package_in, src_dir=src_dir_in, package_omit=package_omit_in, ) assert cfg.dict() == { "select": {Check.W001, Check.W002}, "ignore": {Check.W003, Check.W004}, "toplevel": toplevel_out, "package_paths": package_out, "src_dirs": src_dir_out, "package_omit": package_omit_out, }