forked from softlayer/softlayer-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject_storage_tests.py
More file actions
35 lines (29 loc) · 1.22 KB
/
object_storage_tests.py
File metadata and controls
35 lines (29 loc) · 1.22 KB
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
32
33
34
35
"""
SoftLayer.tests.managers.object_storage_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
import SoftLayer
from SoftLayer import fixtures
from SoftLayer import testing
class ObjectStorageTests(testing.TestCase):
def set_up(self):
self.object_storage = SoftLayer.ObjectStorageManager(self.client)
def test_list_accounts(self):
accounts = self.object_storage.list_accounts()
self.assertEqual(accounts,
fixtures.SoftLayer_Account.getHubNetworkStorage)
def test_list_endpoints(self):
accounts = self.set_mock('SoftLayer_Account', 'getHubNetworkStorage')
accounts.return_value = {
'storageNodes': [{
'datacenter': {'name': 'dal05'},
'frontendIpAddress': 'https://dal05/auth/v1.0/',
'backendIpAddress': 'https://dal05/auth/v1.0/'}
],
}
endpoints = self.object_storage.list_endpoints()
self.assertEqual(endpoints,
[{'datacenter': {'name': 'dal05'},
'private': 'https://dal05/auth/v1.0/',
'public': 'https://dal05/auth/v1.0/'}])