Exemplo n.º 1
0
    def test_set_feed_params_in_config_with_default_value(self):
        """
        Given
        - Integration yml with feed field labeled as true and all necessary params exist including defaultvalue fields.

        When
        - Running the format command.

        Then
        - Ensures the defaultvalue fields remain after the execution.
        """
        base_yml = IntegrationYMLFormat(FEED_INTEGRATION_VALID, path="schema_path", verbose=True)
        base_yml.set_feed_params_in_config()
        configuration_params = base_yml.data.get('configuration', [])
        assert 'defaultvalue' in configuration_params[0]
    def test_format_on_feed_integration_adds_feed_parameters(self):
        """
        Given
        - Feed integration yml without feed parameters configured.

        When
        - Running the format command.

        Then
        - Ensures the feed parameters are added.
        """
        base_yml = IntegrationYMLFormat(FEED_INTEGRATION_EMPTY_VALID,
                                        path="schema_path",
                                        verbose=True)
        base_yml.set_feed_params_in_config()
        configuration_params = base_yml.data.get('configuration', [])
        for param_details in FEED_REQUIRED_PARAMS:
            param = {'name': param_details.get('name')}
            param.update(param_details.get('must_equal', dict()))
            param.update(param_details.get('must_contain', dict()))
            assert param in configuration_params