Beispiel #1
0
 def test_get(self):
     backup = _backup.Backup(id='backup')
     member = _member.Member(id='member')
     self._verify('openstack.proxy.Proxy._get',
                  self.proxy.get_member,
                  method_args=[backup, member],
                  method_kwargs={},
                  expected_args=[_member.Member, member],
                  expected_kwargs={'backup_id': backup.id})
 def test_basic(self):
     sot = member.Member()
     self.assertEqual('member', sot.resource_key)
     self.assertEqual('members', sot.resources_key)
     self.assertEqual('/backups/%(backup_id)s/members', sot.base_path)
     self.assertTrue(sot.allow_list)
     self.assertTrue(sot.allow_create)
     self.assertTrue(sot.allow_fetch)
     self.assertTrue(sot.allow_commit)
     self.assertTrue(sot.allow_delete)
 def setUp(self):
     super(TestMember, self).setUp()
     self.sess = mock.Mock(spec=adapter.Adapter)
     self.sess.default_microversion = None
     self.sess.get = mock.Mock()
     self.sess.post = mock.Mock()
     self.sess.delete = mock.Mock()
     self.sess.put = mock.Mock()
     self.sess.retriable_status_codes = ()
     self.sot = member.Member()
Beispiel #4
0
 def test_delete(self):
     backup = _backup.Backup(id='backup')
     member = _member.Member(id='member')
     self._verify('openstack.proxy.Proxy._delete',
                  self.proxy.delete_member,
                  method_args=[backup, member, True],
                  method_kwargs={},
                  expected_args=[_member.Member, member],
                  expected_kwargs={
                      'backup_id': backup.id,
                      'ignore_missing': True
                  })
Beispiel #5
0
 def test_update(self):
     backup = _backup.Backup(id='backup')
     member = _member.Member(id='member')
     status = 'accepted'
     vault = _vault.Vault(id='vault')
     self._verify('openstack.proxy.Proxy._update',
                  self.proxy.update_member,
                  method_args=[backup, member, status, vault],
                  method_kwargs={},
                  expected_args=[_member.Member, member],
                  expected_kwargs={
                      'backup_id': backup.id,
                      'status': status,
                      'vault_id': vault.id
                  })