예제 #1
0
def test_switch():
    ret = parse_args([
        "--file-1",
        MOCK_FILE_PATH,
        "--" + OPTION_SWITCH,
    ])
    assert vars(ret)[OPTION_SWITCH] is not OPTION_SWITCH_DEFAULT
예제 #2
0
 def test_switch(self):
     """Test switch parameter."""
     ret = parse_args([
         "--file-1",
         MOCK_FILE_PATH,
         "--" + OPTION_SWITCH,
     ])
     assert vars(ret)[OPTION_SWITCH] is not OPTION_SWITCH_DEFAULT
예제 #3
0
 def test_invalid_option(self):
     """Test invalid argument."""
     with pytest.raises(SystemExit):
         assert parse_args([OPTION_INVALID])
예제 #4
0
 def test_no_args(self):
     """Call without args."""
     with pytest.raises(SystemExit):
         parse_args([])
예제 #5
0
 def test_help_option(self):
     """Test help option."""
     with pytest.raises(SystemExit):
         assert parse_args(["--" + OPTION_HELP])
예제 #6
0
def test_invalid_option():
    with pytest.raises(SystemExit):
        assert parse_args([OPTION_INVALID])
예제 #7
0
def test_no_args():
    with pytest.raises(SystemExit):
        parse_args([])
예제 #8
0
def test_help_option():
    with pytest.raises(SystemExit):
        assert parse_args(["--" + OPTION_HELP])