Exemple #1
0
 def test_parsing_commandline_build_file(self):
     assert "some_file" == _pynt._create_parser().parse_args(["-f", "some_file"]).file
     assert "build.py" == _pynt._create_parser().parse_args([]).file
     assert "/foo/bar" == _pynt._create_parser().parse_args(["--file", "/foo/bar"]).file
     with pytest.raises(SystemExit):
         _pynt._create_parser().parse_args(["--file"])
     with pytest.raises(SystemExit):
         _pynt._create_parser().parse_args(["-f"])
Exemple #2
0
    def test_parsing_commandline_build_file(self):
        assert "some_file" == _pynt._create_parser().parse_args(
            ["-f", "some_file"]).file
        assert "build.py" == _pynt._create_parser().parse_args([]).file
        assert "/foo/bar" == _pynt._create_parser().parse_args(
            ["--file", "/foo/bar"]).file

        with pytest.raises(SystemExit):
            _pynt._create_parser().parse_args(["--file"])
        with pytest.raises(SystemExit):
            _pynt._create_parser().parse_args(["-f"])
Exemple #3
0
 def test_parsing_commandline_build_file(self):
     assert "some_file" == _pynt._create_parser().parse_args(["-f", "some_file"]).file
     assert "build.py" == _pynt._create_parser().parse_args([]).file
     assert "/foo/bar" == _pynt._create_parser().parse_args(
         ["--file", "/foo/bar"]).file
     
     #These assertions dont work on 3.3 on travis(only)
     #Reported on travis forum. Works fine on 3.3 on macos, windows
     #Some bug in python 3.3 installation on travis
     if not('TRAVIS_PYTHON_VERSION' in os.environ and
            os.environ['TRAVIS_PYTHON_VERSION'] == '3.3'):
         with pytest.raises(SystemExit):
             _pynt._create_parser().parse_args(["--file"])
         with pytest.raises(SystemExit):
             _pynt._create_parser().parse_args(["-f"])
Exemple #4
0
 def test_parsing_commandline_help(self):
     assert _pynt._create_parser().parse_args(["-l"]).list_tasks
     assert _pynt._create_parser().parse_args([ "--list-tasks"]).list_tasks
Exemple #5
0
 def test_parsing_commandline(self):
     args = _pynt._create_parser().parse_args(['-f', "foo.py", "task1", "task2"])
     assert "foo.py" == args.file
     assert not args.list_tasks
     assert ['task1', 'task2'] == args.tasks
Exemple #6
0
 def test_parsing_commandline_help(self):
     assert _pynt._create_parser().parse_args(["-l"]).list_tasks
     assert _pynt._create_parser().parse_args(["--list-tasks"]).list_tasks
Exemple #7
0
 def test_parsing_commandline(self):
     args = _pynt._create_parser().parse_args(
         ['-f', "foo.py", "task1", "task2"])
     assert "foo.py" == args.file
     assert not args.list_tasks
     assert ['task1', 'task2'] == args.tasks