Example #1
0
    def test_config_reset_all(self):
        # given
        config_manager = ConfigurableManager()
        test_config = {"1": "2"}
        node_id = 1
        config_manager.set_configs(test_config)
        config_manager.set_configs(test_config, node_id=node_id)

        # when
        config_manager.config_reset()

        # then
        assert not config_manager.node_configurations
Example #2
0
    def test_config_reset_node(self):
        # given
        config_manager = ConfigurableManager()
        test_config = {"1": "2"}
        node_id = 1
        config_manager.set_configs(test_config)
        config_manager.set_configs(test_config, node_id=node_id)

        # when
        config_manager.config_reset(node_id)

        # then
        assert not config_manager.get_configs(node_id=node_id)
        assert config_manager.get_configs()
Example #3
0
    def test_nodes(self):
        # given
        config_manager = ConfigurableManager()
        test_config = {"1": "2"}
        node_id = 1
        config_manager.set_configs(test_config)
        config_manager.set_configs(test_config, node_id=node_id)

        # when
        nodes = config_manager.nodes()

        # then
        assert len(nodes) == 1
        assert node_id in nodes
Example #4
0
    def test_configs_setget(self):
        # given
        config_manager = ConfigurableManager()
        test_config = {"1": "2"}
        node_id = 1
        config_manager.set_configs(test_config)
        config_manager.set_configs(test_config, node_id=node_id)

        # when
        default_config = config_manager.get_configs()
        node_config = config_manager.get_configs(node_id)

        # then
        assert default_config
        assert node_config