示例#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"])
示例#2
0
文件: test_pynt.py 项目: nsvir/pynt
    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"])
示例#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"])
示例#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
示例#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
示例#6
0
文件: test_pynt.py 项目: nsvir/pynt
 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
示例#7
0
文件: test_pynt.py 项目: nsvir/pynt
 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