def test_unable_to_create(self):
     with mock.patch("remoteappmanager.tests.mocking."
                     "dummy.DummyDB.create_application") as mock_create_app:
         mock_create_app.side_effect = UnsupportedOperation()
         self.post("/user/johndoe/api/v1/applications/",
                   {"image_name": "foobar"},
                   httpstatus.INTERNAL_SERVER_ERROR)
 def test_unable_to_delete(self):
     with mock.patch(
             "remoteappmanager.tests.mocking."
             "dummy.DummyDB.revoke_access_by_id") as mock_delete_user:
         mock_delete_user.side_effect = UnsupportedOperation()
         self.delete(
             "/user/johndoe/api/v1/accounting/cbaee2e8ef414f9fb0f1c97416b8aa6c/",  # noqa
             httpstatus.INTERNAL_SERVER_ERROR)
 def test_unable_to_create(self):
     with mock.patch("remoteappmanager.tests.mocking."
                     "dummy.DummyDB.grant_access") as mock_grant_access:
         mock_grant_access.side_effect = UnsupportedOperation()
         self.post(
             "/user/johndoe/api/v1/accounting/", {
                 "user_id": "0",
                 "image_name": "image_id1",
                 "allow_home": True,
                 "volume_source": "/foo",
                 "volume_target": "/bar",
                 "volume_mode": "ro"
             }, httpstatus.INTERNAL_SERVER_ERROR)
Esempio n. 4
0
 def revoke_access_by_id(self, mapping_id):
     raise UnsupportedOperation()
Esempio n. 5
0
 def revoke_access(self, app_name, user_name, allow_home, allow_view,
                   volume):
     raise UnsupportedOperation()
Esempio n. 6
0
 def remove_application(self, *, app_name=None, id=None):
     raise UnsupportedOperation()
Esempio n. 7
0
 def create_application(self, app_name):
     raise UnsupportedOperation()
Esempio n. 8
0
 def remove_user(self, *, user_name=None, id=None):
     raise UnsupportedOperation()
Esempio n. 9
0
 def create_user(self, user_name):
     raise UnsupportedOperation()
 def test_unable_to_delete(self):
     with mock.patch("remoteappmanager.tests.mocking."
                     "dummy.DummyDB.remove_application") as mock_delete_app:
         mock_delete_app.side_effect = UnsupportedOperation()
         self.delete("/user/johndoe/api/v1/applications/1/",
                     httpstatus.INTERNAL_SERVER_ERROR)