Beispiel #1
0
    def test__ensure_storm_path_in_configs_path_not_found(self, mock_search):
        mock_configs = mock.Mock(specs=["storm_cmd_path"])
        mock_configs.storm_cmd_path = None
        mock_search.return_value = None

        with pytest.raises(ConfigurationError):
            subcommand._ensure_storm_path_in_configs(mock_configs)

            mock_search.assert_called_with()
Beispiel #2
0
    def test__ensure_storm_path_in_configs_path_not_found(self, mock_search):
        mock_configs = mock.Mock(specs=['storm_cmd_path'])
        mock_configs.storm_cmd_path = None
        mock_search.return_value = None

        with pytest.raises(ConfigurationError):
            subcommand._ensure_storm_path_in_configs(mock_configs)

            mock_search.assert_called_with()
Beispiel #3
0
    def test__ensure_storm_path_in_configs_path_defined(self, mock_update, mock_search):
        mock_configs = mock.Mock(specs=["storm_cmd_path"])

        configs = subcommand._ensure_storm_path_in_configs(mock_configs)

        assert mock_search.called == 0
        assert mock_update.called == 0
        assert configs == mock_configs
Beispiel #4
0
    def test__ensure_storm_path_in_configs_path_not_defined(self, mock_update, mock_search):
        mock_configs = mock.Mock(specs=["storm_cmd_path"])
        mock_configs.storm_cmd_path = None

        configs = subcommand._ensure_storm_path_in_configs(mock_configs)

        mock_search.assert_called_with()
        mock_update.assert_called_with(mock_configs, {"storm_cmd_path": mock_search.return_value})
        assert configs == mock_update.return_value
Beispiel #5
0
    def test__ensure_storm_path_in_configs_path_defined(
            self, mock_update, mock_search):
        mock_configs = mock.Mock(specs=['storm_cmd_path'])

        configs = subcommand._ensure_storm_path_in_configs(mock_configs)

        assert mock_search.called == 0
        assert mock_update.called == 0
        assert configs == mock_configs
Beispiel #6
0
    def test__ensure_storm_path_in_configs_path_not_defined(
            self, mock_update, mock_search):
        mock_configs = mock.Mock(specs=['storm_cmd_path'])
        mock_configs.storm_cmd_path = None

        configs = subcommand._ensure_storm_path_in_configs(mock_configs)

        mock_search.assert_called_with()
        mock_update.assert_called_with(
            mock_configs, {'storm_cmd_path': mock_search.return_value})
        assert configs == mock_update.return_value