summaryrefslogtreecommitdiff
path: root/test/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.py')
-rw-r--r--test/test.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/test.py b/test/test.py
index f871bb9..02216ac 100644
--- a/test/test.py
+++ b/test/test.py
@@ -13,11 +13,12 @@ import main
13class Mat2WebTestCase(unittest.TestCase): 13class Mat2WebTestCase(unittest.TestCase):
14 def setUp(self): 14 def setUp(self):
15 os.environ.setdefault('MAT2_ALLOW_ORIGIN_WHITELIST', 'origin1.gnu origin2.gnu') 15 os.environ.setdefault('MAT2_ALLOW_ORIGIN_WHITELIST', 'origin1.gnu origin2.gnu')
16 app = main.create_app()
17 self.upload_folder = tempfile.mkdtemp() 16 self.upload_folder = tempfile.mkdtemp()
18 app.config.update( 17 app = main.create_app(
19 TESTING=True, 18 test_config={
20 UPLOAD_FOLDER=self.upload_folder 19 'TESTING': True,
20 'UPLOAD_FOLDER': self.upload_folder
21 }
21 ) 22 )
22 self.app = app.test_client() 23 self.app = app.test_client()
23 24
@@ -127,7 +128,7 @@ class Mat2WebTestCase(unittest.TestCase):
127 rv = self.app.get('/download/70623619c449a040968cdbea85945bf384fa30ed2d5d24fa3/test.cleaned.txt') 128 rv = self.app.get('/download/70623619c449a040968cdbea85945bf384fa30ed2d5d24fa3/test.cleaned.txt')
128 self.assertEqual(rv.status_code, 302) 129 self.assertEqual(rv.status_code, 302)
129 130
130 @patch('file_removal_scheduler.random.randint') 131 @patch('matweb.file_removal_scheduler.random.randint')
131 def test_upload_leftover(self, randint_mock): 132 def test_upload_leftover(self, randint_mock):
132 randint_mock.return_value = 0 133 randint_mock.return_value = 0
133 os.environ['MAT2_MAX_FILE_AGE_FOR_REMOVAL'] = '0' 134 os.environ['MAT2_MAX_FILE_AGE_FOR_REMOVAL'] = '0'