cleaning up temp
This commit is contained in:
@@ -50,6 +50,22 @@ class AsyncTaskTests(TestCase):
|
|||||||
workouttype = 'water',
|
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):
|
def test_safetimedelta(self):
|
||||||
x = 5
|
x = 5
|
||||||
y = tasks.safetimedelta(x)
|
y = tasks.safetimedelta(x)
|
||||||
@@ -411,7 +427,7 @@ class AsyncTaskTests(TestCase):
|
|||||||
@patch('rowers.dataprepnodjango.getsmallrowdata_db')
|
@patch('rowers.dataprepnodjango.getsmallrowdata_db')
|
||||||
def test_handle_setcp(self,mocked_getsmallrowdata_db):
|
def test_handle_setcp(self,mocked_getsmallrowdata_db):
|
||||||
strokesdf = pd.read_csv('rowers/tests/testdata/uhfull.csv')
|
strokesdf = pd.read_csv('rowers/tests/testdata/uhfull.csv')
|
||||||
filename = 'rowers/tests/temp/pq.gz'
|
filename = 'rowers/tests/testdata/temp/pq.gz'
|
||||||
workoutids = 1
|
workoutids = 1
|
||||||
res = tasks.handle_setcp(strokesdf,filename,1)
|
res = tasks.handle_setcp(strokesdf,filename,1)
|
||||||
self.assertEqual(res,1)
|
self.assertEqual(res,1)
|
||||||
|
|||||||
Reference in New Issue
Block a user