This repository was archived by the owner on Dec 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import adif_file
55
66
7+ def get_file_path (file ):
8+ return os .path .join (os .path .dirname (__file__ ), file )
9+
10+
711class DumpADI (unittest .TestCase ):
812 def test_10_pack_header_tag (self ):
913 self .assertEqual ('<PROGRAMID:8>Testprog' , adif_file .pack ('PROGRAMID' , 'Testprog' ))
@@ -108,7 +112,7 @@ def test_30_dump_a_file(self):
108112<TEST1:5>test3 <TEST2:5>test4
109113<EOR>'''
110114
111- temp_file = 'testdata/~test.adi'
115+ temp_file = get_file_path ( 'testdata/~test.adi' )
112116
113117 adif_file .dump_adi (temp_file , adi_dict )
114118
Original file line number Diff line number Diff line change @@ -47,15 +47,16 @@ def test_20_unpack_record(self):
4747 self .assertDictEqual ({'NAME' : 'Test' }, adif_file .unpack (adi_rec_name ))
4848
4949 def test_50_goodfile (self ):
50- adi_dict = adif_file .load_adi ('testdata/goodfile.txt' )
50+ adi_dict = adif_file .load_adi (get_file_path ( 'testdata/goodfile.txt' ) )
5151
5252 self .assertIn ('HEADER' , adi_dict )
5353 self .assertIn ('RECORDS' , adi_dict )
5454 self .assertEqual (3 , len (adi_dict ['HEADER' ]))
5555 self .assertEqual (5 , len (adi_dict ['RECORDS' ]))
5656
5757 def test_55_toomuchheaders (self ):
58- self .assertRaises (adif_file .TooMuchHeadersException , adif_file .load_adi , 'testdata/toomuchheadersfile.txt' )
58+ self .assertRaises (adif_file .TooMuchHeadersException , adif_file .load_adi ,
59+ get_file_path ('testdata/toomuchheadersfile.txt' ))
5960
6061
6162if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments