How to use the greynoise.cli.parser.parse_arguments function in greynoise

To help you get started, we’ve selected a few greynoise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_quick_check_failure(self):
        """Quick check subcommand fails if ip address validation fails."""
        with pytest.raises(SystemExit):
            parse_arguments(["quick_check", ""])
github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_multi_quick_check(self):
        """Multi quick check subcommand called."""
        args = parse_arguments(["multi_quick_check", "0.0.0.0", "0.0.0.1"])
        assert args.func == multi_quick_check
github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_api_key_not_found(self, capsys, load_config):
        """Error is returned if API is not found."""
        load_config.return_value = {"api_key": ""}

        with pytest.raises(SystemExit):
            parse_arguments(["actors"])

        captured = capsys.readouterr()
        assert captured.out.startswith("Error: API key not found")
github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_noise_with_date_failure(self, date_option):
        """Noise with date subcommand fails if date validation fails."""
        with pytest.raises(SystemExit):
            parse_arguments(["noise", date_option, "not-a-date"])
github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_context(self):
        """Context subcommand called."""
        args = parse_arguments(["context", "0.0.0.0"])
        assert args.func == context
github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_quick_check(self):
        """Quick check subcommand called."""
        args = parse_arguments(["quick_check", "0.0.0.0"])
        assert args.func == quick_check
github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_multi_quick_check_failure(self):
        """Multi quick check subcommand fails is ip validatin fails."""
        with pytest.raises(SystemExit):
            parse_arguments(
                [
                    "multi_quick_check",
                    "",
                    "",
                ]
github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_noise_with_date(self, date_option):
        """Noise with date subcommand called."""
        args = parse_arguments(["noise", date_option, "2019-01-01"])
        assert args.func == noise
        assert args.date == datetime.date(2019, 1, 1)
github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_actors(self):
        """Actors subcommand called."""
        args = parse_arguments(["actors"])
        assert args.func == actors
github GreyNoise-Intelligence / pygreynoise / tests / cli / test_parser.py View on Github external
def test_noise(self):
        """Noise subcommand called."""
        args = parse_arguments(["noise"])
        assert args.func == noise