Esempio n. 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
Esempio n. 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
Esempio n. 3
0
 def test_invalid_option(self):
     """Test invalid argument."""
     with pytest.raises(SystemExit):
         assert parse_args([OPTION_INVALID])
Esempio n. 4
0
 def test_no_args(self):
     """Call without args."""
     with pytest.raises(SystemExit):
         parse_args([])
Esempio n. 5
0
 def test_help_option(self):
     """Test help option."""
     with pytest.raises(SystemExit):
         assert parse_args(["--" + OPTION_HELP])
Esempio n. 6
0
def test_invalid_option():
    with pytest.raises(SystemExit):
        assert parse_args([OPTION_INVALID])
Esempio n. 7
0
def test_no_args():
    with pytest.raises(SystemExit):
        parse_args([])
Esempio n. 8
0
def test_help_option():
    with pytest.raises(SystemExit):
        assert parse_args(["--" + OPTION_HELP])