From 90092105e81ccfc69be7207aaf4a804fdc41a8ca Mon Sep 17 00:00:00 2001 From: Samuel Chen Date: Mon, 13 Feb 2017 17:25:19 +0800 Subject: [PATCH] update tests --- pyqueuer/tests/test_utils.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pyqueuer/tests/test_utils.py b/pyqueuer/tests/test_utils.py index 5b3dc00..376ab36 100644 --- a/pyqueuer/tests/test_utils.py +++ b/pyqueuer/tests/test_utils.py @@ -15,8 +15,8 @@ class TestUtils(unittest.TestCase): def test_PropertyDict(self): x = PropertyDict(a=1, b=2, d=4, f=8) - for k, v in x.items(): - print('%s=%s' % (k, v), end=', ') + # for k, v in x.items(): + # print('%s=%s' % (k, v), end=', ') self.assertEqual(x['a'], 1) self.assertEqual(x.b, 2) del x.a @@ -24,6 +24,20 @@ def test_PropertyDict(self): x['c'] = 3 self.assertEqual(x.c, 3) + y = PropertyDict(( + ('a', 2), + ('b', 4), + ('c', 8), + )) + z = [x for x in y.values()] + self.assertEqual(z[0], 2) + self.assertEqual(z[2], 8) + + y['d'] = 16 + del y['b'] + z = [x for x in y.values()] + self.assertEqual(z[2], 16) + def test_OutputBuffer(self): buf = OutputBuffer(maxlen=5) self.assertTrue(buf.empty())