diff options
| author | 2019-12-25 19:40:29 -0500 | |
|---|---|---|
| committer | 2019-12-25 19:40:29 -0500 | |
| commit | d9cde490ce957f56cd2bb9e1628c2c0ef1a8733b (patch) | |
| tree | 13f58a5c602ae402a6b1fc598ce227e9f36f3aa2 /test/test_util.py | |
| parent | f9b17d9842e84709e2a41e92eb1dff0654c430c5 (diff) | |
| parent | f9a1a9dcb7df977eeac9544786df9c0b93795815 (diff) | |
Update upstream source from tag 'upstream/1.12.1'
Update to upstream version '1.12.1'
with Debian dir 6bd6e3209b21195bb26b892f2d85b1324de1f0d9
Diffstat (limited to 'test/test_util.py')
| -rw-r--r-- | test/test_util.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_util.py b/test/test_util.py index 9b252a3..5a103cf 100644 --- a/test/test_util.py +++ b/test/test_util.py @@ -358,6 +358,21 @@ class TestOther(unittest.TestCase): self.assertEqual( d, {1: 123, 2: 123, 3: 0, 4: {11: 321, 12: 321, 13: 0}}) + def test_filter_dict(self): + d = {} + r = util.filter_dict(d) + self.assertEqual(r, d) + self.assertIsNot(r, d) + + d = {"foo": 123, "bar": [], "baz": None} + r = util.filter_dict(d) + self.assertEqual(r, d) + self.assertIsNot(r, d) + + d = {"foo": 123, "_bar": [], "__baz__": None} + r = util.filter_dict(d) + self.assertEqual(r, {"foo": 123}) + def test_number_to_string(self, f=util.number_to_string): self.assertEqual(f(1) , "1") self.assertEqual(f(1.0) , "1.0") |
