From 4d966a1cf9acb21c9f71f2a630da11e4ac848502 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Tue, 1 May 2018 11:15:20 -0400 Subject: Reject keyword and positional arguments in __new__. Fixes #2. --- tests/test_map.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/test_map.py b/tests/test_map.py index 660f742..fe2a131 100644 --- a/tests/test_map.py +++ b/tests/test_map.py @@ -93,6 +93,13 @@ class BaseMapTest: Map = None + def test_init_no_args(self): + with self.assertRaisesRegex(TypeError, 'positional argument'): + self.Map(dict(a=1)) + + with self.assertRaisesRegex(TypeError, 'keyword argument'): + self.Map(a=1) + def test_hashkey_helper_1(self): k1 = HashKey(10, 'aaa') k2 = HashKey(10, 'bbb') -- cgit v1.2.3