Beispiel #1
0
    def test_initialise_store_alerter_calls_initialise_logger_correctly(
            self, mock_init_logger) -> None:
        mock_init_logger.return_value = self.dummy_logger

        _initialise_store(AlertStore, ALERT_STORE_NAME)

        mock_init_logger.assert_called_once_with(ALERT_STORE_NAME,
                                                 AlertStore.__name__)
Beispiel #2
0
    def test_initialise_store_system_calls_initialise_logger_correctly(
            self, mock_init_logger) -> None:
        mock_init_logger.return_value = self.dummy_logger

        _initialise_store(SystemStore, SYSTEM_STORE_NAME)

        mock_init_logger.assert_called_once_with(SYSTEM_STORE_NAME,
                                                 SystemStore.__name__)
Beispiel #3
0
    def test_initialise_store_github_calls_initialise_logger_correctly(
            self, mock_init_logger) -> None:
        mock_init_logger.return_value = self.dummy_logger

        _initialise_store(GithubStore, GITHUB_STORE_NAME)

        mock_init_logger.assert_called_once_with(GITHUB_STORE_NAME,
                                                 GithubStore.__name__)
Beispiel #4
0
    def test_initialise_store_config_calls_initialise_logger_correctly(
            self, mock_init_logger) -> None:
        mock_init_logger.return_value = self.dummy_logger

        _initialise_store(ConfigStore, CONFIG_STORE_NAME)

        mock_init_logger.assert_called_once_with(CONFIG_STORE_NAME,
                                                 ConfigStore.__name__)
Beispiel #5
0
    def test_initialise_store_creates_github_store_correctly(
            self, mock_github_store, mock_init_logger, mock_rabbit) -> None:
        mock_init_logger.return_value = self.dummy_logger
        mock_github_store.__name__ = 'GithubStore'
        mock_rabbit.__name__ = 'RabbitMQApi'
        mock_rabbit.return_value = self.rabbitmq
        _initialise_store(mock_github_store, GITHUB_STORE_NAME)

        mock_init_logger.assert_called_once()
        mock_github_store.assert_called_once_with(GITHUB_STORE_NAME,
                                                  self.dummy_logger,
                                                  self.rabbitmq)
Beispiel #6
0
    def test_initialise_store_creates_system_store_correctly(
            self, mock_system_store, mock_init_logger, mock_rabbit) -> None:
        mock_init_logger.return_value = self.dummy_logger
        mock_system_store.__name__ = 'SystemStore'
        mock_rabbit.__name__ = 'RabbitMQApi'
        mock_rabbit.return_value = self.rabbitmq

        _initialise_store(mock_system_store, SYSTEM_STORE_NAME)

        mock_init_logger.assert_called_once()
        mock_system_store.assert_called_once_with(SYSTEM_STORE_NAME,
                                                  self.dummy_logger,
                                                  self.rabbitmq)