def test_no_env(self, mock_file): with self.assertRaises(CensysException) as context: CensysAsmAPI() self.assertIn("No ASM API key configured.", str(context.exception))
def test_get_exception_class(self, status_code, exception, mock): response = Response() mock.return_value = {"errorCode": status_code} self.assertEqual(CensysAsmAPI()._get_exception_class(response), exception)
def setUp(self): super().setUp() self.setUpApi(CensysAsmAPI(self.api_id))
def test_no_env(self, mock_file): with pytest.raises(CensysException, match="No ASM API key configured."): CensysAsmAPI()
def __init__(self, asset_type, api_key: Optional[str] = None, **kwargs): CensysAsmAPI.__init__(self, api_key, **kwargs) self.base_path = f"assets/{asset_type}"
def __init__(self, api_key: Optional[str] = None, **kwargs): CensysAsmAPI.__init__(self, api_key, **kwargs) self.base_path = "seeds"