summaryrefslogtreecommitdiff
path: root/tests/test_frozendict.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_frozendict.py')
-rw-r--r--tests/test_frozendict.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_frozendict.py b/tests/test_frozendict.py
new file mode 100644
index 0000000..3f8045d
--- /dev/null
+++ b/tests/test_frozendict.py
@@ -0,0 +1,19 @@
1from foundry.utils import frozendict
2from nose.tools import raises
3
4
5class TestFrozenDict(object):
6
7 def setup(self):
8 self.inputs = { 'foo': 'bar' }
9 self.dict_ = frozendict(self.inputs)
10
11 @raises(AttributeError)
12 def test_should_not_allow_assignment(self):
13 self.dict_['bar'] = 'baz'
14
15 def test_should_use_precomputed_hash(self):
16 assert hash(self.dict_) == self.dict_._frozendict__hash
17
18 def test_should_set_slots(self):
19 assert self.dict_.__slots__ == self.inputs.keys()