-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_serializer.py
More file actions
31 lines (24 loc) · 1020 Bytes
/
test_serializer.py
File metadata and controls
31 lines (24 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
"""Serializer tests for the My MinIO addon."""
import mock
import pytest
from addons.base.tests.serializers import StorageAddonSerializerTestSuiteMixin
from addons.myminio.tests.factories import MyMinIOAccountFactory
from addons.myminio.serializer import MyMinIOSerializer
from tests.base import OsfTestCase
pytestmark = pytest.mark.django_db
class TestMyMinIOSerializer(StorageAddonSerializerTestSuiteMixin, OsfTestCase):
addon_short_name = 'myminio'
Serializer = MyMinIOSerializer
ExternalAccountFactory = MyMinIOAccountFactory
client = None
def set_provider_id(self, pid):
self.node_settings.folder_id = pid
def setUp(self):
self.mock_can_list = mock.patch('addons.myminio.serializer.utils.can_list')
self.mock_can_list.return_value = True
self.mock_can_list.start()
super(TestMyMinIOSerializer, self).setUp()
def tearDown(self):
self.mock_can_list.stop()
super(TestMyMinIOSerializer, self).tearDown()