def test_switch():
    ret = parse_args([
        "--file-1",
        MOCK_FILE_PATH,
        "--" + OPTION_SWITCH,
    ])
    assert vars(ret)[OPTION_SWITCH] is not OPTION_SWITCH_DEFAULT
Example #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
Example #3
0
 def test_invalid_option(self):
     """Test invalid argument."""
     with pytest.raises(SystemExit):
         assert parse_args([OPTION_INVALID])
Example #4
0
 def test_no_args(self):
     """Call without args."""
     with pytest.raises(SystemExit):
         parse_args([])
Example #5
0
 def test_help_option(self):
     """Test help option."""
     with pytest.raises(SystemExit):
         assert parse_args(["--" + OPTION_HELP])
def test_invalid_option():
    with pytest.raises(SystemExit):
        assert parse_args([OPTION_INVALID])
def test_no_args():
    with pytest.raises(SystemExit):
        parse_args([])
def test_help_option():
    with pytest.raises(SystemExit):
        assert parse_args(["--" + OPTION_HELP])