File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 2
2
import unittest .mock
3
3
import pandas as pd
4
4
import json
5
+ import time
5
6
from gget .gget_info import info
6
7
7
8
# Load dictionary containing arguments and expected results
8
9
with open ("./tests/fixtures/test_info.json" ) as json_file :
9
10
info_dict = json .load (json_file )
10
11
12
+ # Sleep time in seconds (wait [sleep_time] seconds between server requests to avoid 502 errors for WB and FB IDs)
13
+ sleep_time = 10
11
14
12
15
# todo convert to json loading once wormbase & flybase IDs are fixed. At that point, the json test framework will need a way to handle the ANY values
13
16
class TestInfo (unittest .TestCase ):
@@ -17,6 +20,7 @@ def test_info_WB_transcript(self):
17
20
test = "test2"
18
21
expected_result = info_dict [test ]["expected_result" ]
19
22
result_to_test = info (** info_dict [test ]["args" ])
23
+ time .sleep (sleep_time )
20
24
# If result is a DataFrame, convert to list
21
25
if isinstance (result_to_test , pd .DataFrame ):
22
26
result_to_test = result_to_test .dropna (axis = 1 ).values .tolist ()
@@ -27,6 +31,7 @@ def test_info_FB_gene(self):
27
31
test = "test3"
28
32
expected_result = info_dict [test ]["expected_result" ]
29
33
result_to_test = info (** info_dict [test ]["args" ])
34
+ time .sleep (sleep_time )
30
35
# If result is a DataFrame, convert to list
31
36
if isinstance (result_to_test , pd .DataFrame ):
32
37
result_to_test = result_to_test .dropna (axis = 1 ).values .tolist ()
You can’t perform that action at this time.
0 commit comments