示例#1
0
def test_options_for_gather_missing_mandatory(monkeypatch, arg):
    command = "./gather censys --suffix=.gov --%s" % arg.replace("_", "-")
    monkeypatch.setattr(sys, "argv", command.split(" "))
    subutils.options_for_gather()
    command = "./gather censys --suffix=.gov --%s=" % arg.replace("_", "-")
    monkeypatch.setattr(sys, "argv", command.split(" "))
    subutils.options_for_gather()
示例#2
0
def test_options_for_gather_help(monkeypatch, capsys, args):
    monkeypatch.setattr(sys, "argv", args.split(" "))
    # Handling exception here instead of with decorator because we want to
    # examine the console output.
    with pytest.raises(SystemExit) as exc:
        subutils.options_for_gather()
    assert exc.typename == "SystemExit"
    out, err = capsys.readouterr()
    assert out.startswith("usage: gather GATHERERS")
示例#3
0
def test_options_for_gather_arg_mismatch(monkeypatch, args):
    monkeypatch.setattr(sys, "argv", args.split(" "))
    subutils.options_for_gather()
示例#4
0
def test_options_for_gather_missing_arg_parameter(monkeypatch, args):
    monkeypatch.setattr(sys, "argv", args.split(" "))
    subutils.options_for_gather()
示例#5
0
def test_options_for_gather(monkeypatch, args, expected):
    monkeypatch.setattr(sys, "argv", args.split(" "))
    result = subutils.options_for_gather()
    assert result == expected