10
10
class ServiceTests(utils.TestCase):
12
12
super(ServiceTests, self).setUp()
13
self.TEST_REQUEST_HEADERS = {'X-Auth-Token': 'aToken',
14
'User-Agent': 'python-keystoneclient'}
15
self.TEST_POST_HEADERS = {'Content-Type': 'application/json',
16
'X-Auth-Token': 'aToken',
17
'User-Agent': 'python-keystoneclient'}
18
self.TEST_SERVICES = {"OS-KSADM:services": {
23
"description": "Nova-compatible service.",
29
"description": ("Keystone-compatible "
13
self.TEST_REQUEST_HEADERS = {
14
'X-Auth-Token': 'aToken',
15
'User-Agent': 'python-keystoneclient',
17
self.TEST_POST_HEADERS = {
18
'Content-Type': 'application/json',
19
'X-Auth-Token': 'aToken',
20
'User-Agent': 'python-keystoneclient',
22
self.TEST_SERVICES = {
23
"OS-KSADM:services": {
28
"description": "Nova-compatible service.",
34
"description": "Keystone-compatible service.",
37
41
def test_create(self):
38
req_body = {"OS-KSADM:service": {"name": "swift",
39
"type": "object-store",
40
"description": "Swift-compatible service."}}
41
resp_body = {"OS-KSADM:service": {"name": "swift",
42
"type": "object-store",
43
"description": "Swift-compatible service.",
45
"type": "object-store",
46
"description": "Swift-compatible service.",
52
"type": "object-store",
53
"description": "Swift-compatible service.",
45
57
resp = httplib2.Response({
47
59
"body": json.dumps(resp_body),
78
90
self.client.services.delete(1)
80
92
def test_get(self):
93
test_services = self.TEST_SERVICES['OS-KSADM:services']['values'][0]
81
94
resp = httplib2.Response({
83
"body": json.dumps({'OS-KSADM:service':
84
self.TEST_SERVICES['OS-KSADM:services']['values'][0]}),
96
"body": json.dumps({'OS-KSADM:service': test_services}),
86
98
httplib2.Http.request(urlparse.urljoin(self.TEST_URL,
87
99
'v2.0/OS-KSADM/services/1'),