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
@@ -22,12 +22,12 @@ def api_valid?(api_entry)
22
22
  end
23
23
 
24
24
  # For each OpenStack project version, generates an equivalent of the following example:
25
- # it "Nova v2.1 loads a valid api structure" do
26
- # require "misty/openstack/nova/v2_1"
25
+ # it 'Nova v2.1 loads a valid api structure' do
26
+ # require 'misty/openstack/nova/v2_1'
27
27
  # api = Misty::Openstack::Nova::V2_1.api
28
28
  # api_valid?(api)
29
29
  # end
30
- describe "Openstack API" do
30
+ describe 'Openstack API' do
31
31
  Misty.services.each do |service|
32
32
  service.versions.each do |version|
33
33
  it "#{service.project} #{version} loads a valid api structure" do
@@ -24,11 +24,11 @@ describe Misty::HTTP::Microversion do
24
24
  auth = Minitest::Mock.new
25
25
 
26
26
  def auth.get_endpoint(*args)
27
- "http://localhost"
27
+ 'http://localhost'
28
28
  end
29
29
 
30
30
  def auth.get_token
31
- "token_id"
31
+ 'token_id'
32
32
  end
33
33
 
34
34
  setup = Misty::Cloud::Config.new
@@ -38,37 +38,37 @@ describe Misty::HTTP::Microversion do
38
38
  setup.region_id = Misty::REGION_ID
39
39
  setup.ssl_verify_mode = Misty::SSL_VERIFY_MODE
40
40
 
41
- stub_request(:get, "http://localhost/").
41
+ stub_request(:get, 'http://localhost/').
42
42
  with(:headers => {'Accept'=>'application/json', 'Content-Type'=>'application/json'}).
43
43
  to_return(:status => 200, :body => JSON.dump(versions_data), :headers => {})
44
44
 
45
45
  Misty::Openstack::Nova::V2_1.new(auth, setup, {})
46
46
  end
47
47
 
48
- describe "#version_get" do
49
- it "returns the version number" do
50
- microversion_service.version_get("2.12").must_equal "2.12"
48
+ describe '#version_get' do
49
+ it 'returns the version number' do
50
+ microversion_service.version_get('2.12').must_equal '2.12'
51
51
  end
52
52
 
53
- it "returns the version number" do
54
- microversion_service.version_get("CURRENT").must_equal "2.25"
53
+ it 'returns the version number' do
54
+ microversion_service.version_get('CURRENT').must_equal '2.25'
55
55
  end
56
56
 
57
- it "fails when version is not within supporterd interval" do
57
+ it 'fails when version is not within supporterd interval' do
58
58
  proc do
59
- microversion_service.version_get("2.0")
59
+ microversion_service.version_get('2.0')
60
60
  end.must_raise Misty::HTTP::Microversion::VersionError
61
61
  end
62
62
 
63
- it "fails when LATEST version is not available" do
63
+ it 'fails when LATEST version is not available' do
64
64
  proc do
65
- microversion_service.version_get("LATEST")
65
+ microversion_service.version_get('LATEST')
66
66
  end.must_raise Misty::HTTP::Microversion::VersionError
67
67
  end
68
68
 
69
- it "fails when using an invalid version State" do
69
+ it 'fails when using an invalid version State' do
70
70
  proc do
71
- microversion_service.version_get("OTHER")
71
+ microversion_service.version_get('OTHER')
72
72
  end.must_raise Misty::HTTP::Microversion::VersionError
73
73
  end
74
74
  end
@@ -8,11 +8,11 @@ def service(content_type = :ruby)
8
8
  auth = Minitest::Mock.new
9
9
 
10
10
  def auth.get_endpoint(*args)
11
- "http://localhost"
11
+ 'http://localhost'
12
12
  end
13
13
 
14
14
  def auth.get_token
15
- "token_id"
15
+ 'token_id'
16
16
  end
17
17
 
18
18
  setup = Misty::Cloud::Config.new
@@ -22,9 +22,9 @@ def service(content_type = :ruby)
22
22
  setup.region_id = Misty::REGION_ID
23
23
  setup.ssl_verify_mode = Misty::SSL_VERIFY_MODE
24
24
 
25
- stub_request(:get, "http://localhost/").
25
+ stub_request(:get, 'http://localhost/').
26
26
  with(:headers => request_header).
27
- to_return(:status => 200, :body => "", :headers => {})
27
+ to_return(:status => 200, :body => '', :headers => {})
28
28
 
29
29
  Misty::Openstack::Neutron::V2_0.new(auth, setup, {})
30
30
  end
@@ -1,16 +1,16 @@
1
1
  require 'test_helper'
2
2
 
3
- describe "Services" do
4
- describe "#add" do
5
- it "Adds a service" do
3
+ describe 'Services' do
4
+ describe '#add' do
5
+ it 'Adds a service' do
6
6
  services = Misty::Services.new
7
- services.add(:name, :project, ["v1", "v2.0"])
7
+ services.add(:name, :project, ['v1', 'v2.0'])
8
8
  services.services.size.must_equal 1
9
9
  service = services.services[0]
10
10
  service.must_be_kind_of Misty::Services::Service
11
11
  service.name.must_equal :name
12
12
  service.project.must_equal :project
13
- service.versions.must_include "v1"
13
+ service.versions.must_include 'v1'
14
14
  services.to_s.must_equal %Q{name: project: ["v1", "v2.0"]\n}
15
15
  end
16
16
  end
@@ -1,6 +1,6 @@
1
1
  require 'minitest/autorun'
2
2
  require 'webmock/minitest'
3
- require "misty"
3
+ require 'misty'
4
4
  require 'pry-byebug'
5
5
 
6
6
  module Misty
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: misty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gilles Dubreuil
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-20 00:00:00.000000000 Z
11
+ date: 2017-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.24'
81
+ version: '2.3'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.24'
88
+ version: '2.3'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: vcr
91
91
  requirement: !ruby/object:Gem::Requirement