55
66from cybox .common import Hash , ToolInformation , ToolInformationList
77import cybox .test
8+ from cybox .test import EntityTestCase
89from cybox .test .common .hash_test import EMPTY_MD5
910
1011
11- class TestToolInformation (unittest .TestCase ):
12+ class TestToolInformation (EntityTestCase , unittest .TestCase ):
13+ klass = ToolInformation
1214
13- def test_round_trip (self ):
14- info_dict = {
15- 'id' : "example:Tool-A1" ,
16- 'idref' : "example:Tool-A1-ref" ,
17- 'name' : "AwesomeTool(tm)" ,
18- 'type' : ['NIDS' , 'HIPS' ],
19- 'description' : {'structuring_format' : 'HTML' ,
20- 'value' : '<p>An awesome tool!</p>' },
15+ _full_dict = {
16+ 'id' : "example:Tool-A1" ,
17+ 'idref' : "example:Tool-A1-ref" ,
18+ 'name' : "AwesomeTool(tm)" ,
19+ 'type' : ['NIDS' , 'HIPS' ],
20+ 'description' : {'structuring_format' : 'HTML' ,
21+ 'value' : '<p>An awesome tool!</p>' },
2122
22- 'vendor' : "Awesome Co." ,
23- 'version' : "1.0.0" ,
24- 'service_pack' : 'N/A' ,
23+ 'vendor' : "Awesome Co." ,
24+ 'version' : "1.0.0" ,
25+ 'service_pack' : 'N/A' ,
2526
26- 'tool_hashes' : [{'simple_hash_value' : EMPTY_MD5 ,
27- 'type' : Hash .TYPE_MD5 }],
28- }
29- info_dict2 = cybox .test .round_trip_dict (ToolInformation , info_dict )
30- self .assertEqual (info_dict , info_dict2 )
27+ 'tool_hashes' : [{'simple_hash_value' : EMPTY_MD5 ,
28+ 'type' : Hash .TYPE_MD5 }],
29+ }
3130
3231
3332class TestHashList (unittest .TestCase ):
@@ -37,7 +36,7 @@ def test_round_trip(self):
3736 {'id' : "example:Tool-A1" , 'name' : "Tool 1" },
3837 {'id' : "example:Tool-A2" , 'name' : "Tool 2" },
3938 ]
40- toolinfolist_list2 = cybox .test .round_trip_list (ToolInformationList ,
39+ toolinfolist_list2 = cybox .test .round_trip_list (ToolInformationList ,
4140 toolinfolist_list )
4241 self .assertEqual (toolinfolist_list , toolinfolist_list2 )
4342
0 commit comments