def test_add_keys_nested_with_value_and_dict(self): start_dict = {"asdf": {"1234": "rewq"}} new_dict = utils.add_keys(start_dict, ["foo", "bar", "baz"], "bat") self.assertEqual(new_dict, { "asdf": { "1234": "rewq" }, "foo": { "bar": { "baz": "bat" } } })
def test_add_keys_single_with_value(self): new_dict = utils.add_keys({}, ["foo"], "bar") self.assertEqual(new_dict, {"foo": "bar"})
def test_add_keys_single(self): new_dict = utils.add_keys({}, ["foo"]) self.assertEqual(new_dict, {"foo": None})
def test_add_keys_nested_with_value(self): new_dict = utils.add_keys({}, ["foo", "bar", "baz"], "bat") self.assertEqual(new_dict, {"foo": {"bar": {"baz": "bat"}}})
def test_add_keys_nested(self): new_dict = utils.add_keys({}, ["foo", "bar", "baz"]) self.assertEqual(new_dict, {"foo": {"bar": {"baz": None}}})