Пример #1
0
    def test_get_config_empty_yaml(self):
        """Ensure an empty furious.yaml will produce a default config."""
        from furious.config import default_config
        from furious.config import _parse_yaml_config

        example_yaml = str('')

        my_config = _parse_yaml_config(example_yaml)

        self.assertEqual(my_config, default_config())
Пример #2
0
    def test_get_config_empty_yaml(self):
        """Ensure an empty furious.yaml will produce a default config."""
        from furious.config import default_config
        from furious.config import _parse_yaml_config

        example_yaml = str('')

        my_config = _parse_yaml_config(example_yaml)

        self.assertEqual(my_config, default_config())
Пример #3
0
    def test_get_config(self):
        """Ensure a config contents produces the expected dictionary."""
        from furious.config import _parse_yaml_config

        example_yaml = str('secret_key: "blah"\n'
                           'persistence: bubble\n'
                           'task_system: flah\n')

        my_config = _parse_yaml_config(example_yaml)

        self.assertEqual(my_config, {'secret_key': 'blah',
                                     'persistence': 'bubble',
                                     'task_system': 'flah'})
Пример #4
0
    def test_get_config(self):
        """Ensure a config contents produces the expected dictionary."""
        from furious.config import _parse_yaml_config

        example_yaml = str('secret_key: "blah"\n'
                           'persistence: bubble\n'
                           'task_system: flah\n')

        my_config = _parse_yaml_config(example_yaml)

        self.assertEqual(my_config, {
            'secret_key': 'blah',
            'persistence': 'bubble',
            'task_system': 'flah'
        })
Пример #5
0
    def test_get_configured_persistence_exists(self):
        """Ensure a chosen persistence module is selected."""
        from furious.config import _parse_yaml_config

        example_yaml = str('secret_key: "blah"\n'
                           'persistence: bubble\n'
                           'task_system: flah\n')

        my_config = _parse_yaml_config(example_yaml)

        from furious import config

        config._config = my_config

        persistence_module = config.get_default_persistence_engine(
            {'bubble': 'furious.config'})

        self.assertEqual(persistence_module, config)
Пример #6
0
    def test_get_configured_persistence_exists(self):
        """Ensure a chosen persistence module is selected."""
        from furious.config import _parse_yaml_config

        example_yaml = str('secret_key: "blah"\n'
                           'persistence: bubble\n'
                           'task_system: flah\n')

        my_config = _parse_yaml_config(example_yaml)

        from furious import config

        config._config = my_config

        persistence_module = config.get_default_persistence_engine(
            {'bubble': 'furious.config'})

        self.assertEqual(persistence_module, config)