@@ -67,12 +67,21 @@ def test_map(setup_and_cleanup):
6767 parse (project , test_raw_data_dir , test_output_dir )
6868 apply_mapping (project , timeframes , test_output_dir , force_map )
6969
70- output_file = test_output_dir / project / f'{ timeframes [0 ]} .csv'
70+ output_file = test_output_dir / project / f'mapped_data/{ timeframes [0 ]} .csv'
71+ assert not output_file .is_file () # since there is no data from 2010 in the sample
72+
73+ yearly_output_file = test_output_dir / project / f'mapped_data/{ timeframes [0 ][:4 ]} .csv'
74+ assert not yearly_output_file .is_file ()
75+
76+ output_file = test_output_dir / project / f'mapped_data/{ timeframes [1 ]} .csv'
7177 assert output_file .is_file ()
7278
73- yearly_output_file = test_output_dir / project / f'{ timeframes [0 ][:4 ]} .csv'
79+ yearly_output_file = test_output_dir / project / f'mapped_data/ { timeframes [1 ][:4 ]} .csv'
7480 assert yearly_output_file .is_file ()
7581
82+ output_file = test_output_dir / project / f'mapped_data/{ timeframes [2 ]} .csv'
83+ assert output_file .is_file ()
84+
7685 try :
7786 os .remove (str (pool_info_dir / f'clusters/{ project } .json' )) # Remove temp pool info file
7887 except FileNotFoundError :
@@ -131,7 +140,7 @@ def test_bitcoin_mapping(setup_and_cleanup):
131140 'GBMiners,GBMiners,2'
132141 ]
133142
134- output_file = test_output_dir / project / f'{ timeframes [0 ]} .csv'
143+ output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ]} .csv'
135144 with open (output_file ) as f :
136145 for idx , line in enumerate (f .readlines ()):
137146 assert line == expected_output [idx ]
@@ -144,7 +153,7 @@ def test_bitcoin_mapping(setup_and_cleanup):
144153 'Unknown,1AM2fYfpY3ZeMeCKXmN66haoWxvB89pJUx,1'
145154 ]
146155
147- yearly_output_file = test_output_dir / project / f'{ timeframes [0 ][:4 ]} .csv'
156+ yearly_output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ][:4 ]} .csv'
148157 with open (yearly_output_file ) as f :
149158 for idx , line in enumerate (f .readlines ()):
150159 assert expected_output [idx ] == line
@@ -161,7 +170,7 @@ def test_bitcoin_mapping(setup_and_cleanup):
161170 'Bitmain,Bitmain,1' ,
162171 ]
163172
164- output_file = test_output_dir / project / f'{ timeframes [0 ]} .csv'
173+ output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ]} .csv'
165174 with open (output_file ) as f :
166175 for idx , line in enumerate (f .readlines ()):
167176 assert expected_output [idx ] == line
@@ -233,12 +242,12 @@ def test_ethereum_mapping(setup_and_cleanup):
233242 'Unknown,0x45133a7e1cc7e18555ae8a4ee632a8a61de90df6,1'
234243 ]
235244
236- output_file = test_output_dir / project / f'{ timeframes [0 ]} .csv'
245+ output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ]} .csv'
237246 with open (output_file ) as f :
238247 for idx , line in enumerate (f .readlines ()):
239248 assert expected_output [idx ] == line
240249
241- yearly_output_file = test_output_dir / project / f'{ timeframes [0 ][:4 ]} .csv'
250+ yearly_output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ][:4 ]} .csv'
242251 with open (yearly_output_file ) as f :
243252 for idx , line in enumerate (f .readlines ()):
244253 assert expected_output [idx ] == line
@@ -254,7 +263,7 @@ def test_ethereum_mapping(setup_and_cleanup):
254263 'MEV Builder: 0x3B...436,MEV Builder: 0x3B...436,1'
255264 ]
256265
257- output_file = test_output_dir / project / f'{ timeframes [0 ]} .csv'
266+ output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ]} .csv'
258267 with open (output_file ) as f :
259268 for idx , line in enumerate (f .readlines ()):
260269 assert expected_output [idx ] == line
@@ -313,12 +322,12 @@ def test_cardano_mapping(setup_and_cleanup):
313322 '1percentpool,1percentpool,1'
314323 ]
315324
316- output_file = test_output_dir / project / f'{ timeframes [0 ]} .csv'
325+ output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ]} .csv'
317326 with open (output_file ) as f :
318327 for idx , line in enumerate (f .readlines ()):
319328 assert expected_output [idx ] == line
320329
321- yearly_output_file = test_output_dir / project / f'{ timeframes [0 ][:4 ]} .csv'
330+ yearly_output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ][:4 ]} .csv'
322331 with open (yearly_output_file ) as f :
323332 for idx , line in enumerate (f .readlines ()):
324333 assert expected_output [idx ] == line
@@ -385,12 +394,12 @@ def test_tezos_mapping(setup_and_cleanup):
385394 'Unknown,----- UNDEFINED MINER -----,1'
386395 ]
387396
388- output_file = test_output_dir / project / f'{ timeframes [0 ]} .csv'
397+ output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ]} .csv'
389398 with open (output_file ) as f :
390399 for idx , line in enumerate (f .readlines ()):
391400 assert expected_output [idx ] == line
392401
393- yearly_output_file = test_output_dir / project / f'{ timeframes [0 ][:4 ]} .csv'
402+ yearly_output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ][:4 ]} .csv'
394403 with open (yearly_output_file ) as f :
395404 for idx , line in enumerate (f .readlines ()):
396405 assert expected_output [idx ] == line
@@ -406,7 +415,7 @@ def test_tezos_mapping(setup_and_cleanup):
406415 'Unknown,tz0000000000000000000000000000000000,1'
407416 ]
408417
409- output_file = test_output_dir / project / f'{ timeframes [0 ]} .csv'
418+ output_file = test_output_dir / project / f'mapped_data/ { timeframes [0 ]} .csv'
410419 with open (output_file ) as f :
411420 for idx , line in enumerate (f .readlines ()):
412421 assert expected_output [idx ] == line
@@ -426,7 +435,8 @@ def test_tezos_mapping(setup_and_cleanup):
426435
427436
428437def test_get_reward_addresses ():
429- default_mapping = DefaultMapping ("sample_bitcoin" , None )
438+ some_path = pathlib .Path ()
439+ default_mapping = DefaultMapping ("sample_bitcoin" , some_path )
430440
431441 block = {
432442 "number" : 625113 ,
@@ -465,7 +475,8 @@ def test_get_reward_addresses():
465475 reward_addresses = default_mapping .get_reward_addresses (block )
466476 assert reward_addresses is None
467477
468- eth_mapping = EthereumMapping ("sample_ethereum" , None )
478+ some_path = pathlib .Path ()
479+ eth_mapping = EthereumMapping ("sample_ethereum" , some_path )
469480 block = {
470481 "number" : 6982695 ,
471482 "timestamp" : "2018-12-31 00:00:12+00:00" ,
@@ -477,7 +488,8 @@ def test_get_reward_addresses():
477488
478489
479490def test_from_known_addresses ():
480- cardano_mapping = CardanoMapping ("sample_cardano" , None )
491+ some_path = pathlib .Path ()
492+ cardano_mapping = CardanoMapping ("sample_cardano" , some_path )
481493
482494 block = {
483495 "number" : 92082690 ,
0 commit comments