Skip to content

Commit

Permalink
🧪 Add test for #4942
Browse files Browse the repository at this point in the history
  • Loading branch information
foosel committed Feb 5, 2024
1 parent 4159c8c commit 779ffe3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/settings/_files/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ devel:
enabled: true
capabilities:
autoreport_temp: false
empty:
value:
a: true
3 changes: 3 additions & 0 deletions tests/settings/_files/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ test:
a1: 1
a2: 2
a3: 3
empty:
value:
a: false
7 changes: 7 additions & 0 deletions tests/settings/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,13 @@ def test_set_by_path(self):

self.assertEqual(flattened, self.chainmap._chainmap.maps[0])

def test_set_empty_dict(self):
self.assertTrue(_key("empty", "value", "a") in self.chainmap._chainmap.maps[0])

self.chainmap.set_by_path(["empty", "value"], {})

self.assertFalse(_key("empty", "value", "a") in self.chainmap._chainmap.maps[0])

def test_del_by_path(self):
self.chainmap.del_by_path(
["devel", "virtualPrinter", "capabilities", "autoreport_temp"]
Expand Down

0 comments on commit 779ffe3

Please sign in to comment.