Beispiel #1
0
    def test_list(self):
        quota = resources.QuotaMixin()
        quota.tenant_uuid = None
        self.assertEqual([], quota.list())

        quota.tenant_uuid = mock.MagicMock()
        self.assertEqual([quota.tenant_uuid], quota.list())
Beispiel #2
0
    def test_delete(self):
        quota = resources.QuotaMixin()
        mock_manager = mock.MagicMock()
        quota._manager = lambda: mock_manager
        quota.raw_resource = mock.MagicMock()

        quota.delete()
        mock_manager.delete.assert_called_once_with(quota.raw_resource)
Beispiel #3
0
 def test_id(self):
     quota = resources.QuotaMixin()
     quota.raw_resource = mock.MagicMock()
     self.assertEqual(quota.raw_resource, quota.id())