Пример #1
0
    def test_remove_access(self):
        project_id = "456"
        extra_specs = {constants.ExtraSpecs.DRIVER_HANDLES_SHARE_SERVERS: "true"}
        share_type = share_types.create(self.context, "type1", projects=["456"], extra_specs=extra_specs)
        share_type_id = share_type.get("id")

        share_types.remove_share_type_access(self.context, share_type_id, project_id)
        stype_access = db.share_type_access_get_all(self.context, share_type_id)
        self.assertNotIn(project_id, stype_access)
Пример #2
0
    def test_add_access(self):
        project_id = "456"
        extra_specs = {constants.ExtraSpecs.DRIVER_HANDLES_SHARE_SERVERS: "true"}
        share_type = share_types.create(self.context, "type1", extra_specs)
        share_type_id = share_type.get("id")

        share_types.add_share_type_access(self.context, share_type_id, project_id)
        stype_access = db.share_type_access_get_all(self.context, share_type_id)
        self.assertIn(project_id, [a.project_id for a in stype_access])
Пример #3
0
    def test_add_access(self):
        project_id = '456'
        extra_specs = {
            constants.ExtraSpecs.DRIVER_HANDLES_SHARE_SERVERS: 'true'
        }
        share_type = share_types.create(self.context, 'type1', extra_specs)
        share_type_id = share_type.get('id')

        share_types.add_share_type_access(self.context, share_type_id,
                                          project_id)
        stype_access = db.share_type_access_get_all(self.context,
                                                    share_type_id)
        self.assertIn(project_id, [a.project_id for a in stype_access])
Пример #4
0
    def test_remove_access(self):
        project_id = '456'
        extra_specs = {
            constants.ExtraSpecs.DRIVER_HANDLES_SHARE_SERVERS: 'true'
        }
        share_type = share_types.create(
            self.context, 'type1', projects=['456'], extra_specs=extra_specs)
        share_type_id = share_type.get('id')

        share_types.remove_share_type_access(self.context, share_type_id,
                                             project_id)
        stype_access = db.share_type_access_get_all(self.context,
                                                    share_type_id)
        self.assertNotIn(project_id, stype_access)