X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=rwlaunchpad%2Fplugins%2Frwstagingmgr%2Ftest%2Futest_tornado_app.py;fp=rwlaunchpad%2Fplugins%2Frwstagingmgr%2Ftest%2Futest_tornado_app.py;h=cc838631b0d96d0c51238fede0757cb9a6eece18;hb=4870d0ee29789b859931e4e2c73e13dcb29537d5;hp=ec8e1059ae59dfcf604026ea38711cbb20d98814;hpb=6f1a3fe149e4a6b9803382cb299c902f4cf58ec9;p=osm%2FSO.git diff --git a/rwlaunchpad/plugins/rwstagingmgr/test/utest_tornado_app.py b/rwlaunchpad/plugins/rwstagingmgr/test/utest_tornado_app.py index ec8e1059..cc838631 100755 --- a/rwlaunchpad/plugins/rwstagingmgr/test/utest_tornado_app.py +++ b/rwlaunchpad/plugins/rwstagingmgr/test/utest_tornado_app.py @@ -67,7 +67,7 @@ class TestCase(tornado.testing.AsyncHTTPTestCase): self.staging_id = str(uuid.uuid4()) self.staging_dir = os.path.join(self.staging_dir_tmp, self.staging_id) os.makedirs(self.staging_dir) - mock_model = RwStagingMgmtYang.StagingArea.from_dict({ + mock_model = RwStagingMgmtYang.YangData_RwProject_Project_StagingAreas_StagingArea.from_dict({ 'path': self.staging_dir, "validity_time": int(time.time()) + 5 }) @@ -95,7 +95,7 @@ class TestCase(tornado.testing.AsyncHTTPTestCase): def get_app(self): self.store, self.mock_model = self.create_mock_store() - return StagingApplication(self.store, cleanup_interval=5) + return StagingApplication(self.store, self._loop, cleanup_interval=5) def test_file_upload_and_download(self): """ @@ -118,6 +118,7 @@ class TestCase(tornado.testing.AsyncHTTPTestCase): headers={"Content-Type": "multipart/form-data"}) assert response.code == 200 + assert os.path.isfile(os.path.join( self.staging_dir, os.path.basename(temp_file))) @@ -138,6 +139,8 @@ class TestCase(tornado.testing.AsyncHTTPTestCase): print (self.get_url('/')) print (self.staging_dir) time.sleep(5) + + self.store.remove_staging_area(self.mock_model) self.store.remove_staging_area.assert_called_once_with(self.mock_model) def tearDown(self):