def test_parsing_commandline_build_file(self): assert "some_file" == _brick_wall_build._create_parser().parse_args(["-f", "some_file"]).file assert "build.py" == _brick_wall_build._create_parser().parse_args([]).file assert "/foo/bar" == _brick_wall_build._create_parser().parse_args( ["--file", "/foo/bar"]).file with pytest.raises(SystemExit): _brick_wall_build._create_parser().parse_args(["--file"]) with pytest.raises(SystemExit): _brick_wall_build._create_parser().parse_args(["-f"])
def test_parsing_commandline_build_file(self): assert "some_file" == _brick_wall_build._create_parser().parse_args( ["-f", "some_file"]).file assert "build.py" == _brick_wall_build._create_parser().parse_args( []).file assert "/foo/bar" == _brick_wall_build._create_parser().parse_args( ["--file", "/foo/bar"]).file with pytest.raises(SystemExit): _brick_wall_build._create_parser().parse_args(["--file"]) with pytest.raises(SystemExit): _brick_wall_build._create_parser().parse_args(["-f"])
def test_parsing_commandline_help(self): assert _brick_wall_build._create_parser().parse_args(["-l"]).list_tasks assert _brick_wall_build._create_parser().parse_args(["--list-tasks" ]).list_tasks
def test_parsing_commandline(self): args = _brick_wall_build._create_parser().parse_args( ['-f', "foo.py", "task1", "task2"]) assert "foo.py" == args.file assert not args.list_tasks assert ['task1', 'task2'] == args.tasks
def test_parsing_commandline_help(self): assert _brick_wall_build._create_parser().parse_args(["-l"]).list_tasks assert _brick_wall_build._create_parser().parse_args([ "--list-tasks"]).list_tasks
def test_parsing_commandline(self): args = _brick_wall_build._create_parser().parse_args(['-f', "foo.py", "task1", "task2"]) assert "foo.py" == args.file assert not args.list_tasks assert ['task1', 'task2'] == args.tasks