Exemplo n.º 1
0
    def test_get_backend_env_var(self):
        """Test dynamically getting the validator class"""
        config = Configuration(self.example_config_data)

        b = config.get_backend()
        b.setup()

        assert isinstance(b, BossBackend)
Exemplo n.º 2
0
    def test_get_backend(self):
        """Test dynamically getting the validator class"""
        patcher = mock.patch(
            'ingestclient.core.backend.BossBackend.get_default_token_file_name'
        )
        mock_cred_path = patcher.start()
        mock_cred_path.side_effect = token_name_side_effect

        config = Configuration(self.example_config_data)

        b = config.get_backend()
        b.setup(self.api_token)

        assert isinstance(b, BossBackend)