示例#1
0
文件: test_funky.py 项目: jml/funky
 def test_introduce_value(self):
     d = {'a': 42}
     with mutated_dict(d, {'b': 21}):
         self.assertEqual({'a': 42, 'b': 21}, d)
     self.assertEqual({'a': 42}, d)
示例#2
0
文件: test_funky.py 项目: jml/funky
 def test_dict_no_mutation(self):
     d = {'a': 42}
     with mutated_dict(d, {}):
         self.assertEqual({'a': 42}, d)
     self.assertEqual({'a': 42}, d)
示例#3
0
文件: test_funky.py 项目: jml/funky
 def test_override_value(self):
     d = {'a': 42, 'b': 3}
     with mutated_dict(d, {'a': 2}):
         self.assertEqual({'a': 2, 'b': 3}, d)
     self.assertEqual({'a': 42, 'b': 3}, d)
示例#4
0
文件: test_funky.py 项目: jml/funky
 def test_empty_dict_no_mutation(self):
     d = {}
     with mutated_dict(d, {}):
         self.assertEqual({}, d)
     self.assertEqual({}, d)
示例#5
0
 def test_introduce_value(self):
     d = {'a': 42}
     with mutated_dict(d, {'b': 21}):
         self.assertEqual({'a': 42, 'b': 21}, d)
     self.assertEqual({'a': 42}, d)
示例#6
0
 def test_override_value(self):
     d = {'a': 42, 'b': 3}
     with mutated_dict(d, {'a': 2}):
         self.assertEqual({'a': 2, 'b': 3}, d)
     self.assertEqual({'a': 42, 'b': 3}, d)
示例#7
0
 def test_dict_no_mutation(self):
     d = {'a': 42}
     with mutated_dict(d, {}):
         self.assertEqual({'a': 42}, d)
     self.assertEqual({'a': 42}, d)
示例#8
0
 def test_empty_dict_no_mutation(self):
     d = {}
     with mutated_dict(d, {}):
         self.assertEqual({}, d)
     self.assertEqual({}, d)