@@ -48,6 +48,26 @@ def test_dictionary_recursive_dict_normal_key_dinamyc(self):
4848 config = ConfFile (config = {"test-1" : {"test-1-1" : "a" , "test_1-2" : "b" }, "test_2" : "c" })
4949 self .assertEqual (getattr (config , "test_1.test_1_2" ), "b" )
5050
51+ def test_equal_instances_error (self ):
52+ config1 = ConfFile (config = {"test-1" : {"test-1-1" : "a" , "test_1-2" : "b" }, "test_2" : "c" })
53+ config2 = ConfFile (config = {"test-1" : {"test-1-1" : "a" , "test_1-2" : "b" }})
54+ self .assertNotEqual (config1 , config2 )
55+
56+ def test_equal_instances_error2 (self ):
57+ config1 = ConfFile (config = {"test-1" : {"test-1-1" : "a" , "test_1-2" : "b" }})
58+ config2 = {"test-1" : {"test-1-1" : "a" , "test-1-2" : "b" }}
59+ self .assertNotEqual (config1 , config2 )
60+
61+ def test_equal_instances_ok (self ):
62+ config1 = ConfFile (config = {"test-1" : {"test-1-1" : "a" , "test_1-2" : "b" }})
63+ config2 = ConfFile (config = {"test-1" : {"test-1-1" : "a" , "test_1-2" : "b" }})
64+ self .assertEqual (config1 , config2 )
65+
66+ def test_equal_instances_ok2 (self ):
67+ config1 = ConfFile (config = {"test-1" : {"test-1-1" : "a" , "test_1-2" : "b" }})
68+ config2 = {"test_1" : {"test_1_1" : "a" , "test_1_2" : "b" }}
69+ self .assertEqual (config1 , config2 )
70+
5171 def test_dictionary_attribute_not_exists (self ):
5272 config = ConfFile (config = {"test-1" : "a" })
5373 with self .assertRaises (AttrDoesNotExistException ):
@@ -98,3 +118,6 @@ def test_empty_conf_two_levels(self):
98118 def test_empty_conf_three_levels (self ):
99119 config = ConfFile (empty_init = True )
100120 self .assertEqual (config .my_ms .level_two .level_three , {})
121+
122+ if __name__ == '__main__' :
123+ unittest .main ()
0 commit comments