Example #1
0
    def test_get_whois_dataset_obj_unknown(self) -> None:
        """
        Tests of the function which let us get a new WHOIS dataset object.

        In this case, we check the case that an unknown db type was declared.
        """

        self.config_loader.set_custom_config(
            {"cli_testing": {"db_type": "hello"}}
        ).start()

        self.assertRaises(ValueError, lambda: whois.get_whois_dataset_object())
Example #2
0
    def test_get_whois_dataset_obj_csv(self) -> None:
        """
        Tests of the function which let us get a new WHOIS dataset object.

        In this case, we check the case that the CSV was declared.
        """

        self.config_loader.set_custom_config(
            {"cli_testing": {"db_type": "csv"}}
        ).start()

        expected = CSVWhoisDataset
        actual = whois.get_whois_dataset_object()

        self.assertIsInstance(actual, expected)
Example #3
0
    def __post_init__(self) -> None:
        self.stdout_printer = StdoutPrinter()
        self.file_printer = FilePrinter()
        self.whois_dataset = get_whois_dataset_object(
            db_session=self.db_session)
        self.inactive_dataset = get_inactive_dataset_object(
            db_session=self.db_session)
        self.continue_dataset = get_continue_databaset_object(
            db_session=self.db_session)
        self.status_file_generator = StatusFileGenerator().guess_all_settings()
        self.counter = FilesystemCounter()
        self.collection_query_tool = CollectionQueryTool()

        self.header_already_printed = False

        return super().__post_init__()
Example #4
0
    def test_get_whois_dataset_obj_no_config(self) -> None:
        """
        Tests of the function which let us get a new WHOIS dataset object.
        """

        self.assertRaises(RuntimeError, lambda: whois.get_whois_dataset_object())