Exemple #1
0
    def test_one_key(self):
        container = {}
        key = "somekey"
        value = "somevalue"
        set_nested_keys(container, [key], value)

        assert container[key] == value
        assert list(container.keys()) == [key]
Exemple #2
0
    def test_three_keys(self):
        container = {}
        key1, key2, key3 = "somekey1", "somekey2", "somekey3"
        value = "somevalue"
        set_nested_keys(container, [key1, key2, key3], value)

        assert container[key1][key2][key3] == value
        assert list(container.keys()) == [key1]