@@ -42,50 +42,46 @@ def test_get(self):
4242
4343class ResourceInfoTestCase (unittest .TestCase ):
4444 def test_simple (self ):
45- info = ResourceInfo ("a" , name = ("foo" , "bar" ), start = 0 , end = 1 , width = 8 )
46- self .assertEqual (info .name , ("foo" , "bar" ))
45+ info = ResourceInfo ("a" , path = ("foo" , "bar" ), start = 0 , end = 1 , width = 8 )
46+ self .assertEqual (info .path , ("foo" , "bar" ))
4747 self .assertEqual (info .start , 0 )
4848 self .assertEqual (info .end , 1 )
4949 self .assertEqual (info .width , 8 )
5050
51- def test_name_cast (self ):
52- info = ResourceInfo ("a" , name = "foo" , start = 0 , end = 1 , width = 8 )
53- self .assertEqual (info .name , ("foo" ,))
54-
55- def test_wrong_name (self ):
51+ def test_wrong_path (self ):
5652 with self .assertRaisesRegex (TypeError ,
57- r"Name must be a non-empty sequence of non-empty strings, not \(1,\)" ):
58- ResourceInfo ("a" , name = (1 ,), start = 0 , end = 1 , width = 8 )
53+ r"Path must be a non-empty sequence of non-empty strings, not \(1,\)" ):
54+ ResourceInfo ("a" , path = (1 ,), start = 0 , end = 1 , width = 8 )
5955 with self .assertRaisesRegex (TypeError ,
60- r"Name must be a non-empty sequence of non-empty strings, not \(\)" ):
61- ResourceInfo ("a" , name = (), start = 0 , end = 1 , width = 8 )
56+ r"Path must be a non-empty sequence of non-empty strings, not \(\)" ):
57+ ResourceInfo ("a" , path = (), start = 0 , end = 1 , width = 8 )
6258 with self .assertRaisesRegex (TypeError ,
63- r"Name must be a non-empty sequence of non-empty strings, not \('foo', ''\)" ):
64- ResourceInfo ("a" , name = ("foo" , "" ), start = 0 , end = 1 , width = 8 )
59+ r"Path must be a non-empty sequence of non-empty strings, not \('foo', ''\)" ):
60+ ResourceInfo ("a" , path = ("foo" , "" ), start = 0 , end = 1 , width = 8 )
6561
6662 def test_wrong_start_addr (self ):
6763 with self .assertRaisesRegex (TypeError ,
6864 r"Start address must be a non-negative integer, not 'foo'" ):
69- ResourceInfo ("a" , name = "b" , start = "foo" , end = 1 , width = 8 )
65+ ResourceInfo ("a" , path = ( "b" ,) , start = "foo" , end = 1 , width = 8 )
7066 with self .assertRaisesRegex (TypeError ,
7167 r"Start address must be a non-negative integer, not -1" ):
72- ResourceInfo ("a" , name = "b" , start = - 1 , end = 1 , width = 8 )
68+ ResourceInfo ("a" , path = ( "b" ,) , start = - 1 , end = 1 , width = 8 )
7369
7470 def test_wrong_end_addr (self ):
7571 with self .assertRaisesRegex (TypeError ,
7672 r"End address must be an integer greater than the start address, not 'foo'" ):
77- ResourceInfo ("a" , name = "b" , start = 0 , end = "foo" , width = 8 )
73+ ResourceInfo ("a" , path = ( "b" ,) , start = 0 , end = "foo" , width = 8 )
7874 with self .assertRaisesRegex (TypeError ,
7975 r"End address must be an integer greater than the start address, not 0" ):
80- ResourceInfo ("a" , name = "b" , start = 0 , end = 0 , width = 8 )
76+ ResourceInfo ("a" , path = ( "b" ,) , start = 0 , end = 0 , width = 8 )
8177
8278 def test_wrong_width (self ):
8379 with self .assertRaisesRegex (TypeError ,
8480 r"Width must be a non-negative integer, not 'foo'" ):
85- ResourceInfo ("a" , name = "b" , start = 0 , end = 1 , width = "foo" )
81+ ResourceInfo ("a" , path = ( "b" ,) , start = 0 , end = 1 , width = "foo" )
8682 with self .assertRaisesRegex (TypeError ,
8783 r"Width must be a non-negative integer, not -1" ):
88- ResourceInfo ("a" , name = "b" , start = 0 , end = 1 , width = - 1 )
84+ ResourceInfo ("a" , path = ( "b" ,) , start = 0 , end = 1 , width = - 1 )
8985
9086
9187class MemoryMapTestCase (unittest .TestCase ):
@@ -391,37 +387,37 @@ def test_iter_all_resources(self):
391387 res_info = list (self .root .all_resources ())
392388
393389 self .assertIs (res_info [0 ].resource , self .res1 )
394- self .assertEqual (res_info [0 ].name , ("name1" ,))
390+ self .assertEqual (res_info [0 ].path , ("name1" ,))
395391 self .assertEqual (res_info [0 ].start , 0x00000000 )
396392 self .assertEqual (res_info [0 ].end , 0x00000010 )
397393 self .assertEqual (res_info [0 ].width , 32 )
398394
399395 self .assertIs (res_info [1 ].resource , self .res2 )
400- self .assertEqual (res_info [1 ].name , ("name2" ,))
396+ self .assertEqual (res_info [1 ].path , ("name2" ,))
401397 self .assertEqual (res_info [1 ].start , 0x00010000 )
402398 self .assertEqual (res_info [1 ].end , 0x00010020 )
403399 self .assertEqual (res_info [1 ].width , 32 )
404400
405401 self .assertIs (res_info [2 ].resource , self .res3 )
406- self .assertEqual (res_info [2 ].name , ("name3" ,))
402+ self .assertEqual (res_info [2 ].path , ("name3" ,))
407403 self .assertEqual (res_info [2 ].start , 0x00010020 )
408404 self .assertEqual (res_info [2 ].end , 0x00010040 )
409405 self .assertEqual (res_info [2 ].width , 32 )
410406
411407 self .assertIs (res_info [3 ].resource , self .res4 )
412- self .assertEqual (res_info [3 ].name , ("name4" ,))
408+ self .assertEqual (res_info [3 ].path , ("name4" ,))
413409 self .assertEqual (res_info [3 ].start , 0x00020000 )
414410 self .assertEqual (res_info [3 ].end , 0x00020001 )
415411 self .assertEqual (res_info [3 ].width , 32 )
416412
417413 self .assertIs (res_info [4 ].resource , self .res5 )
418- self .assertEqual (res_info [4 ].name , ("name5" ,))
414+ self .assertEqual (res_info [4 ].path , ("name5" ,))
419415 self .assertEqual (res_info [4 ].start , 0x00030000 )
420416 self .assertEqual (res_info [4 ].end , 0x00030010 )
421417 self .assertEqual (res_info [4 ].width , 8 )
422418
423419 self .assertIs (res_info [5 ].resource , self .res6 )
424- self .assertEqual (res_info [5 ].name , ("win3" , "name6" ))
420+ self .assertEqual (res_info [5 ].path , ("win3" , "name6" ))
425421 self .assertEqual (res_info [5 ].start , 0x00040000 )
426422 self .assertEqual (res_info [5 ].end , 0x00040004 )
427423 self .assertEqual (res_info [5 ].width , 32 )
@@ -430,7 +426,7 @@ def test_find_resource(self):
430426 for res_info in self .root .all_resources ():
431427 other = self .root .find_resource (res_info .resource )
432428 self .assertIs (other .resource , res_info .resource )
433- self .assertEqual (other .name , res_info .name )
429+ self .assertEqual (other .path , res_info .path )
434430 self .assertEqual (other .start , res_info .start )
435431 self .assertEqual (other .end , res_info .end )
436432 self .assertEqual (other .width , res_info .width )
0 commit comments