Private
Public Access
1
0

cleaning up temp

This commit is contained in:
Sander Roosendaal
2021-01-16 14:00:20 +01:00
parent 54f8f34acc
commit 687093e0e4

View File

@@ -50,6 +50,22 @@ class AsyncTaskTests(TestCase):
workouttype = 'water',
)
def tearDown(self):
for workout in self.user_workouts:
try:
os.remove(workout.csvfilename)
except (IOError,OSError,FileNotFoundError):
pass
for filename in os.listdir('rowers/tests/testdata/temp'):
path = os.path.join('rowers/tests/testdata/temp/',filename)
if not os.path.isdir(path):
try:
os.remove(path)
except:
pass
def test_safetimedelta(self):
x = 5
y = tasks.safetimedelta(x)
@@ -411,7 +427,7 @@ class AsyncTaskTests(TestCase):
@patch('rowers.dataprepnodjango.getsmallrowdata_db')
def test_handle_setcp(self,mocked_getsmallrowdata_db):
strokesdf = pd.read_csv('rowers/tests/testdata/uhfull.csv')
filename = 'rowers/tests/temp/pq.gz'
filename = 'rowers/tests/testdata/temp/pq.gz'
workoutids = 1
res = tasks.handle_setcp(strokesdf,filename,1)
self.assertEqual(res,1)