77 get_fru_inventory_from_file )
88
99
10+ this_file_path = os .path .dirname (os .path .abspath (__file__ ))
11+
1012def test_frudata_object ():
1113 fru_field = FruData ((0 , 1 , 2 , 3 ))
1214 assert fru_field .data [0 ] == 0
@@ -26,15 +28,13 @@ def test_commonheader_object():
2628
2729
2830def test_fru_inventory_from_file ():
29- path = os .path .dirname (os .path .abspath (__file__ ))
30- fru_file = os .path .join (path , 'fru_bin/kontron_am4010.bin' )
31+ fru_file = os .path .join (this_file_path , 'fru_bin/kontron_am4010.bin' )
3132 fru = get_fru_inventory_from_file (fru_file )
3233 assert fru .chassis_info_area is None
3334
3435
3536def test_board_area ():
36- path = os .path .dirname (os .path .abspath (__file__ ))
37- fru_file = os .path .join (path , 'fru_bin/kontron_am4010.bin' )
37+ fru_file = os .path .join (this_file_path , 'fru_bin/kontron_am4010.bin' )
3838 fru = get_fru_inventory_from_file (fru_file )
3939
4040 board_area = fru .board_info_area
@@ -45,8 +45,7 @@ def test_board_area():
4545
4646
4747def test_product_area ():
48- path = os .path .dirname (os .path .abspath (__file__ ))
49- fru_file = os .path .join (path , 'fru_bin/kontron_am4010.bin' )
48+ fru_file = os .path .join (this_file_path , 'fru_bin/kontron_am4010.bin' )
5049 fru = get_fru_inventory_from_file (fru_file )
5150
5251 product_area = fru .product_info_area
@@ -57,8 +56,7 @@ def test_product_area():
5756
5857
5958def test_multirecord_with_power_module_capability_record ():
60- path = os .path .dirname (os .path .abspath (__file__ ))
61- fru_file = os .path .join (path , 'fru_bin/vadatech_utc017.bin' )
59+ fru_file = os .path .join (this_file_path , 'fru_bin/vadatech_utc017.bin' )
6260 fru = get_fru_inventory_from_file (fru_file )
6361 assert len (fru .multirecord_area .records ) == 1
6462 record = fru .multirecord_area .records [0 ]
0 commit comments