misty 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -23
  3. data/lib/misty/auth.rb +24 -19
  4. data/lib/misty/auth/auth_v2.rb +12 -12
  5. data/lib/misty/auth/auth_v3.rb +15 -15
  6. data/lib/misty/autoload.rb +27 -27
  7. data/lib/misty/cloud.rb +2 -1
  8. data/lib/misty/http/client.rb +17 -15
  9. data/lib/misty/http/method_builder.rb +1 -1
  10. data/lib/misty/http/net_http.rb +12 -7
  11. data/lib/misty/http/request.rb +13 -7
  12. data/lib/misty/misty.rb +30 -30
  13. data/lib/misty/openstack/aodh/v2.rb +1 -1
  14. data/lib/misty/openstack/ceilometer/v2.rb +1 -1
  15. data/lib/misty/openstack/cinder/v1.rb +2 -2
  16. data/lib/misty/openstack/cinder/v2.rb +2 -2
  17. data/lib/misty/openstack/cinder/v3.rb +2 -2
  18. data/lib/misty/openstack/designate/v2.rb +1 -1
  19. data/lib/misty/openstack/freezer/v1.rb +1 -1
  20. data/lib/misty/openstack/glance/v1.rb +1 -1
  21. data/lib/misty/openstack/glance/v2.rb +1 -1
  22. data/lib/misty/openstack/heat/v1.rb +2 -2
  23. data/lib/misty/openstack/ironic/v1.rb +2 -2
  24. data/lib/misty/openstack/karbor/v1.rb +1 -1
  25. data/lib/misty/openstack/keystone/v2_0.rb +2 -2
  26. data/lib/misty/openstack/keystone/v3.rb +2 -2
  27. data/lib/misty/openstack/magnum/v1.rb +2 -2
  28. data/lib/misty/openstack/manila/v2.rb +2 -2
  29. data/lib/misty/openstack/microversion.rb +9 -9
  30. data/lib/misty/openstack/murano/v1.rb +1 -1
  31. data/lib/misty/openstack/neutron/v2_0.rb +1 -1
  32. data/lib/misty/openstack/nova/v2_1.rb +4 -4
  33. data/lib/misty/openstack/octavia/v2_0.rb +1 -1
  34. data/lib/misty/openstack/sahara/v1_1.rb +1 -1
  35. data/lib/misty/openstack/searchlight/v1.rb +1 -1
  36. data/lib/misty/openstack/senlin/v1.rb +1 -1
  37. data/lib/misty/openstack/swift/v1.rb +1 -1
  38. data/lib/misty/openstack/tacker/v1_0.rb +1 -1
  39. data/lib/misty/openstack/trove/v1_0.rb +1 -1
  40. data/lib/misty/openstack/zaqar/v2.rb +1 -1
  41. data/lib/misty/services.rb +1 -1
  42. data/lib/misty/version.rb +1 -1
  43. data/test/integration/compute_test.rb +17 -17
  44. data/test/integration/network_test.rb +16 -16
  45. data/test/integration/orchestration_test.rb +51 -51
  46. data/test/integration/test_helper.rb +7 -7
  47. data/test/unit/auth/name_test.rb +53 -53
  48. data/test/unit/auth_test.rb +151 -152
  49. data/test/unit/cloud/requests_test.rb +58 -58
  50. data/test/unit/cloud/services_test.rb +62 -62
  51. data/test/unit/cloud_test.rb +48 -48
  52. data/test/unit/http/client_test.rb +21 -28
  53. data/test/unit/http/direct_test.rb +31 -31
  54. data/test/unit/http/method_builder_test.rb +42 -42
  55. data/test/unit/http/request_test.rb +33 -33
  56. data/test/unit/misty_test.rb +28 -28
  57. data/test/unit/openstack/APIs_test.rb +3 -3
  58. data/test/unit/openstack/microversion_test.rb +14 -14
  59. data/test/unit/service_helper.rb +4 -4
  60. data/test/unit/services_test.rb +5 -5
  61. data/test/unit/test_helper.rb +1 -1
  62. metadata +4 -4
@@ -1,14 +1,14 @@
1
1
  require 'test_helper'
2
2
  require 'auth_helper'
3
3
 
4
- describe "Misty::Cloud" do
4
+ describe 'Misty::Cloud' do
5
5
  let(:cloud) do
6
6
  auth = {
7
- :url => "http://localhost:5000",
8
- :user => "admin",
9
- :password => "secret",
10
- :project => "admin",
11
- :project_domain_id => "default"
7
+ :url => 'http://localhost:5000',
8
+ :user => 'admin',
9
+ :password => 'secret',
10
+ :project => 'admin',
11
+ :project_domain_id => 'default'
12
12
  }
13
13
 
14
14
  Misty::Cloud.new(:auth => auth)
@@ -53,15 +53,15 @@ describe "Misty::Cloud" do
53
53
  'id' => 'v2.1' }] }
54
54
  end
55
55
 
56
- let(:token_header) { {"x-subject-token"=>"token_data"} }
56
+ let(:token_header) { {'x-subject-token'=>'token_data'} }
57
57
 
58
- it "fails when method is missing" do
58
+ it 'fails when method is missing' do
59
59
  proc do
60
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
60
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
61
61
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
62
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("compute", "nova")), :headers => token_header)
62
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('compute', 'nova')), :headers => token_header)
63
63
 
64
- stub_request(:get, "http://localhost/").
64
+ stub_request(:get, 'http://localhost/').
65
65
  with(:headers => auth_headers).
66
66
  to_return(:status => 200, :body => JSON.dump(versions), :headers => {})
67
67
 
@@ -69,141 +69,141 @@ describe "Misty::Cloud" do
69
69
  end.must_raise NoMethodError
70
70
  end
71
71
 
72
- it "#backup" do
73
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
72
+ it '#backup' do
73
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
74
74
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
75
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("backup", "freezer")), :headers => token_header)
75
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('backup', 'freezer')), :headers => token_header)
76
76
 
77
77
  cloud.backup.must_be_kind_of Misty::Openstack::Freezer::V1
78
78
  end
79
79
 
80
- it "#baremetal" do
81
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
80
+ it '#baremetal' do
81
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
82
82
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
83
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("baremetal", "ironic")), :headers => token_header)
83
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('baremetal', 'ironic')), :headers => token_header)
84
84
 
85
- stub_request(:get, "http://localhost/").
85
+ stub_request(:get, 'http://localhost/').
86
86
  with(:headers => auth_headers).
87
87
  to_return(:status => 200, :body => JSON.dump(versions), :headers => {})
88
88
 
89
89
  cloud.baremetal.must_be_kind_of Misty::Openstack::Ironic::V1
90
90
  end
91
91
 
92
- it "#blockStorage" do
93
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
92
+ it '#blockStorage' do
93
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
94
94
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
95
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("volume", "cinder")), :headers => token_header)
95
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('volume', 'cinder')), :headers => token_header)
96
96
 
97
97
  cloud.block_storage.must_be_kind_of Misty::Openstack::Cinder::V3
98
98
  end
99
99
 
100
- it "#compute" do
101
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
100
+ it '#compute' do
101
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
102
102
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
103
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("compute", "nova")), :headers => token_header)
103
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('compute', 'nova')), :headers => token_header)
104
104
 
105
- stub_request(:get, "http://localhost/").
105
+ stub_request(:get, 'http://localhost/').
106
106
  with(:headers => auth_headers).
107
107
  to_return(:status => 200, :body => JSON.dump(versions), :headers => {})
108
108
 
109
109
  cloud.compute.must_be_kind_of Misty::Openstack::Nova::V2_1
110
110
  end
111
111
 
112
- it "#dataProcessing" do
113
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
112
+ it '#dataProcessing' do
113
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
114
114
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
115
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("data-processing", "sahara")), :headers => token_header)
115
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('data-processing', 'sahara')), :headers => token_header)
116
116
 
117
117
  cloud.data_processing.must_be_kind_of Misty::Openstack::Sahara::V1_1
118
118
  end
119
119
 
120
- it "#identity" do
121
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
120
+ it '#identity' do
121
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
122
122
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
123
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("identity", "keystone")), :headers => token_header)
123
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => token_header)
124
124
 
125
125
  cloud.identity.must_be_kind_of Misty::Openstack::Keystone::V3
126
126
  end
127
127
 
128
- it "#image" do
129
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
128
+ it '#image' do
129
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
130
130
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
131
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("image", "glance")), :headers => token_header)
131
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('image', 'glance')), :headers => token_header)
132
132
 
133
133
  cloud.image.must_be_kind_of Misty::Openstack::Glance::V2
134
134
  end
135
135
 
136
- it "#load_balancer" do
137
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
136
+ it '#load_balancer' do
137
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
138
138
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
139
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("load-balancer", "octavia")), :headers => token_header)
139
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('load-balancer', 'octavia')), :headers => token_header)
140
140
 
141
141
  cloud.load_balancer.must_be_kind_of Misty::Openstack::Octavia::V2_0
142
142
  end
143
143
 
144
- it "#networking" do
145
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
144
+ it '#networking' do
145
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
146
146
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
147
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("networking", "neutron")), :headers => token_header)
147
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('networking', 'neutron')), :headers => token_header)
148
148
 
149
149
  cloud.networking.must_be_kind_of Misty::Openstack::Neutron::V2_0
150
150
  end
151
151
 
152
- it "#nfv_orchestration" do
153
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
152
+ it '#nfv_orchestration' do
153
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
154
154
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
155
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("nfv-orchestration", "tacker")), :headers => token_header)
155
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('nfv-orchestration', 'tacker')), :headers => token_header)
156
156
 
157
157
  cloud.nfv_orchestration.must_be_kind_of Misty::Openstack::Tacker::V1_0
158
158
  end
159
159
 
160
- it "#objectStorage" do
161
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
160
+ it '#objectStorage' do
161
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
162
162
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
163
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("object-store", "swift")), :headers => token_header)
163
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('object-store', 'swift')), :headers => token_header)
164
164
 
165
165
  cloud.object_storage.must_be_kind_of Misty::Openstack::Swift::V1
166
166
  end
167
167
 
168
- it "#orchestration" do
169
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
168
+ it '#orchestration' do
169
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
170
170
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
171
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("orchestration", "heat")), :headers => token_header)
171
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('orchestration', 'heat')), :headers => token_header)
172
172
 
173
173
  cloud.orchestration.must_be_kind_of Misty::Openstack::Heat::V1
174
174
  end
175
175
 
176
- it "#search" do
177
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
176
+ it '#search' do
177
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
178
178
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
179
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("search", "searchlight")), :headers => token_header)
179
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('search', 'searchlight')), :headers => token_header)
180
180
 
181
181
  cloud.search.must_be_kind_of Misty::Openstack::Searchlight::V1
182
182
  end
183
183
 
184
- it "#sharedFileSystems" do
185
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
184
+ it '#sharedFileSystems' do
185
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
186
186
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
187
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("shared-file-systems", "manila")), :headers => token_header)
187
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('shared-file-systems', 'manila')), :headers => token_header)
188
188
 
189
- stub_request(:get, "http://localhost/").
189
+ stub_request(:get, 'http://localhost/').
190
190
  with(:headers => auth_headers).
191
191
  to_return(:status => 200, :body => JSON.dump(versions), :headers => {})
192
192
 
193
193
  cloud.shared_file_systems.must_be_kind_of Misty::Openstack::Manila::V2
194
194
  end
195
195
 
196
- describe "prefixed service name" do
197
- it "#network match networking" do
198
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
196
+ describe 'prefixed service name' do
197
+ it '#network match networking' do
198
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
199
199
  with(:body => JSON.dump(auth_body), :headers => auth_headers).
200
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("networking", "neutron")), :headers => token_header)
200
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('networking', 'neutron')), :headers => token_header)
201
201
 
202
202
  cloud.network.must_be_kind_of Misty::Openstack::Neutron::V2_0
203
203
  end
204
204
 
205
- it "#data is ambiguous" do
206
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
205
+ it '#data is ambiguous' do
206
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
207
207
  with(:body => JSON.dump(auth_body), :headers => auth_headers)
208
208
 
209
209
  proc do
@@ -2,48 +2,48 @@ require 'test_helper'
2
2
  require 'service_helper'
3
3
  require 'auth_helper'
4
4
 
5
- describe "#dot_to_underscore" do
6
- it "returns a valid name" do
7
- name = Misty::Cloud.dot_to_underscore("v20.90.01")
8
- name.must_equal "v20_90_01"
5
+ describe '#dot_to_underscore' do
6
+ it 'returns a valid name' do
7
+ name = Misty::Cloud.dot_to_underscore('v20.90.01')
8
+ name.must_equal 'v20_90_01'
9
9
  end
10
10
  end
11
11
 
12
12
  describe Misty::Cloud do
13
- describe "A service" do
13
+ describe 'A service' do
14
14
  let(:auth) do
15
- stub_request(:post, "http://localhost:5000/v3/auth/tokens").
15
+ stub_request(:post, 'http://localhost:5000/v3/auth/tokens').
16
16
  with(:body => "{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"name\":\"admin\",\"domain\":{\"id\":\"default\"},\"password\":\"secret\"}}},\"scope\":{\"project\":{\"name\":\"admin\",\"domain\":{\"id\":\"default\"}}}}}",
17
17
  :headers => {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Ruby'}).
18
- to_return(:status => 200, :body => JSON.dump(auth_response_v3("identity", "keystone")), :headers => {"x-subject-token"=>"token_data"})
18
+ to_return(:status => 200, :body => JSON.dump(auth_response_v3('identity', 'keystone')), :headers => {'x-subject-token'=>'token_data'})
19
19
 
20
20
  auth = {
21
- :url => "http://localhost:5000",
22
- :user => "admin",
23
- :password => "secret",
24
- :project => "admin",
21
+ :url => 'http://localhost:5000',
22
+ :user => 'admin',
23
+ :password => 'secret',
24
+ :project => 'admin',
25
25
  :project_domain_id => 'default'
26
26
  }
27
27
  end
28
28
 
29
- it "uses default version" do
29
+ it 'uses default version' do
30
30
  cloud = Misty::Cloud.new(:auth => auth)
31
31
  cloud.identity.must_be_kind_of Misty::Openstack::Keystone::V3
32
32
  end
33
33
 
34
- it "uses default version when provided version is out of range" do
35
- cloud = Misty::Cloud.new(:auth => auth, :identity => {:api_version => "v1"})
34
+ it 'uses default version when provided version is out of range' do
35
+ cloud = Misty::Cloud.new(:auth => auth, :identity => {:api_version => 'v1'})
36
36
  cloud.identity.must_be_kind_of Misty::Openstack::Keystone::V3
37
37
  end
38
38
 
39
- it "uses provided version" do
40
- cloud = Misty::Cloud.new(:auth => auth, :identity => {:api_version => "v2.0"})
39
+ it 'uses provided version' do
40
+ cloud = Misty::Cloud.new(:auth => auth, :identity => {:api_version => 'v2.0'})
41
41
  cloud.identity.must_be_kind_of Misty::Openstack::Keystone::V2_0
42
42
  end
43
43
  end
44
44
 
45
- describe "Each service" do
46
- it "has a method defined" do
45
+ describe 'Each service' do
46
+ it 'has a method defined' do
47
47
  Misty::services.each do |service|
48
48
  method = Misty::Cloud.method_defined?(service.name)
49
49
  method.must_equal true
@@ -51,8 +51,8 @@ describe Misty::Cloud do
51
51
  end
52
52
  end
53
53
 
54
- describe "#config" do
55
- it "sets up default values" do
54
+ describe '#config' do
55
+ it 'sets up default values' do
56
56
  Misty::Auth.stub :factory, nil do
57
57
  config = Misty::Cloud.set_configuration({})
58
58
  config.must_be_kind_of Misty::Cloud::Config
@@ -65,31 +65,31 @@ describe Misty::Cloud do
65
65
  end
66
66
  end
67
67
 
68
- describe "#new" do
69
- describe "fails" do
70
- it "when no parameters" do
68
+ describe '#new' do
69
+ describe 'fails' do
70
+ it 'when no parameters' do
71
71
  proc do
72
72
  Misty::Cloud.new
73
73
  end.must_raise ArgumentError
74
74
  end
75
75
 
76
- it "with empty credentials" do
76
+ it 'with empty credentials' do
77
77
  proc do
78
78
  Misty::Cloud.new(:auth => {})
79
79
  end.must_raise Misty::Auth::URLError
80
80
  end
81
81
 
82
- it "with incomplete credentials" do
82
+ it 'with incomplete credentials' do
83
83
  proc do
84
- Misty::Cloud.new(:auth => {:user => "user", :url => "http://localhost" })
84
+ Misty::Cloud.new(:auth => {:user => 'user', :url => 'http://localhost' })
85
85
  end.must_raise Misty::Auth::CredentialsError
86
86
  end
87
87
 
88
- it "without url" do
88
+ it 'without url' do
89
89
  authv3_data = {
90
- :user => "admin",
91
- :password => "secret",
92
- :project => "admin"
90
+ :user => 'admin',
91
+ :password => 'secret',
92
+ :project => 'admin'
93
93
  }
94
94
 
95
95
  proc do
@@ -97,12 +97,12 @@ describe Misty::Cloud do
97
97
  end.must_raise Misty::Auth::URLError
98
98
  end
99
99
 
100
- it "with empty url" do
100
+ it 'with empty url' do
101
101
  authv3_data = {
102
- :url => "",
103
- :user => "admin",
104
- :password => "secret",
105
- :project => "admin"
102
+ :url => '',
103
+ :user => 'admin',
104
+ :password => 'secret',
105
+ :project => 'admin'
106
106
  }
107
107
 
108
108
  proc do
@@ -111,18 +111,18 @@ describe Misty::Cloud do
111
111
  end
112
112
  end
113
113
 
114
- describe "Authenticates" do
115
- describe "with v2 credentials" do
114
+ describe 'Authenticates' do
115
+ describe 'with v2 credentials' do
116
116
  let(:authv2_data) do
117
117
  {
118
- :url => "http://localhost:5000",
119
- :user => "admin",
120
- :password => "secret",
121
- :tenant => "admin"
118
+ :url => 'http://localhost:5000',
119
+ :user => 'admin',
120
+ :password => 'secret',
121
+ :tenant => 'admin'
122
122
  }
123
123
  end
124
124
 
125
- it "uses AuthV2" do
125
+ it 'uses AuthV2' do
126
126
  authv2 = Minitest::Mock.new
127
127
 
128
128
  Misty::AuthV2.stub :new, authv2 do
@@ -132,17 +132,17 @@ describe Misty::Cloud do
132
132
  end
133
133
  end
134
134
 
135
- describe "with v3 credentials" do
135
+ describe 'with v3 credentials' do
136
136
  let(:authv3_data) do
137
137
  {
138
- :url => "http://localhost:5000",
139
- :user => "admin",
140
- :password => "secret",
141
- :project => "admin"
138
+ :url => 'http://localhost:5000',
139
+ :user => 'admin',
140
+ :password => 'secret',
141
+ :project => 'admin'
142
142
  }
143
143
  end
144
144
 
145
- it "uses AuthV3" do
145
+ it 'uses AuthV3' do
146
146
  authv3 = Minitest::Mock.new
147
147
 
148
148
  Misty::AuthV3.stub :new, authv3 do
@@ -3,71 +3,64 @@ require 'service_helper'
3
3
  require 'misty/http/client'
4
4
 
5
5
  describe Misty::HTTP::Client do
6
- describe "#self.prefix_path_to_ignore" do
6
+ describe '#self.prefix_path_to_ignore' do
7
7
  it "returns empty String when undefined in API's module" do
8
8
  Misty::Openstack::Neutron::V2_0::prefix_path_to_ignore.must_be_empty
9
9
  end
10
10
 
11
11
  it "returns String when defined in API's module" do
12
- Misty::Openstack::Cinder::V3.prefix_path_to_ignore.must_equal "/v3/{tenant_id}"
12
+ Misty::Openstack::Cinder::V3.prefix_path_to_ignore.must_equal '/v3/{tenant_id}'
13
13
  end
14
14
  end
15
15
 
16
- describe "#requests" do
17
- it "returns list of requests" do
16
+ describe '#requests' do
17
+ it 'returns list of requests' do
18
18
  list = service.requests
19
19
  list.must_be_kind_of Array
20
20
  list.must_include :list_service_profiles
21
21
  end
22
22
  end
23
23
 
24
- describe "#headers_default" do
25
- it "returns hash" do
24
+ describe '#headers_default' do
25
+ it 'returns hash' do
26
26
  service.headers_default.must_be_kind_of Hash
27
27
  end
28
28
  end
29
29
 
30
- describe "#headers" do
31
- it "returns hash" do
30
+ describe '#headers' do
31
+ it 'returns hash' do
32
32
  service.headers.must_be_kind_of Hash
33
33
  end
34
34
  end
35
35
 
36
- describe "#baseclass" do
37
- it "returns base class name" do
38
- service.send(:baseclass).must_equal "V2_0"
36
+ describe '#baseclass' do
37
+ it 'returns base class name' do
38
+ service.send(:baseclass).must_equal 'V2_0'
39
39
  end
40
40
  end
41
41
 
42
- describe "#net_http" do
43
- it "returns a Net/http instance" do
44
- endpoint = URI.parse("http://localhost")
45
- Misty::HTTP::NetHTTP.net_http(endpoint, false, Logger.new("/dev/null")).must_be_instance_of Net::HTTP
46
- end
47
- end
48
-
49
- describe "#setup" do
50
- it "sets default options" do
42
+ describe '#setup' do
43
+ it 'sets default options' do
51
44
  options = service.send(:setup, {})
52
45
  options.must_be_kind_of Misty::HTTP::Client::Options
53
46
  options.base_path.must_be_nil
54
47
  options.base_url.must_be_nil
55
- options.interface.must_equal "public"
56
- options.region_id.must_equal "regionOne"
57
- options.service_names.must_include "network"
48
+ options.interface.must_equal 'public'
49
+ options.region_id.must_equal 'regionOne'
50
+ options.service_names.must_include 'network'
58
51
  options.ssl_verify_mode.must_equal true
59
- options.version.must_equal "CURRENT"
52
+ options.version.must_equal 'CURRENT'
60
53
  end
61
54
 
62
- it "fails with invalid interface" do
55
+ it 'fails with invalid interface' do
63
56
  proc do
64
- service.send(:setup, {:interface => "something"})
57
+ service.send(:setup, {:interface => 'something'})
65
58
  end.must_raise Misty::HTTP::Client::InvalidDataError
66
59
  end
67
60
 
68
- it "fails unless ssl_verify_mode is a boolean" do
61
+ it 'fails unless ssl_verify_mode is a boolean' do
69
62
  proc do
70
- service.send(:setup, {:ssl_verify_mode => "something"})
63
+ service.send(:setup, {:ssl_verify_mode => 'something'})
71
64
  end.must_raise Misty::HTTP::Client::InvalidDataError
72
65
  end
73
66
  end