amazon-pricing 0.1.73 → 0.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzhlODhkYmE1OGQ1MmU5ZmJiNDMwMTdmNGY0NTRiMmQ0OTY5NDY5Mw==
4
+ YzEzMzA5NjEyOTkzYzczNTZhYWVmZGYzMmYwZTdiZTNiMTQxYmQ2Ng==
5
5
  data.tar.gz: !binary |-
6
- NjA5NGE1MjgwOGIwZjVjNTA4YzA4NWQ0N2JiZTY3OTFjMTQxZWFkYw==
6
+ YjViZDc3N2RkODA5MzdjYTBlZDQ4NWQ1MDlhZmNjNWQ2N2NhYzZjZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODczMjkyN2RjMzc1NzI3ZTQ4MDliOGE2NWEzZDVkYWZhMTJiZTFiMDZiNjg1
10
- MTM5YTVhMDRlZmMwMzc4MWUyYzA4MjZkODBhODlkY2I4YWMyMWMzMjcwMzhl
11
- MmQzNTI1NjBlY2YzZDdkYjQ3YmRkNThjY2RiMjkzYTE3ZjM3YjA=
9
+ ZmIwYzdmNjc4NDQ4Y2VmYzAzMmRmNTFhMDJmZWE1NjVjNWE2MzgwZWRhMjcw
10
+ MWEwNDhhNjE0NzQzYTg4YjMxYWJlMWRkNWRmN2EyNjBjY2ZiOWZiZWMwYjA3
11
+ MTQ3NWZmOTUyNzlmMWZhN2E0YmFiODg3YjU1ZTVlYmY0Zjc5OTA=
12
12
  data.tar.gz: !binary |-
13
- MjczMThkZWM0ZWU1ZjY3YjhjY2E3OWNlM2M1NmUyZmVmMjBiOWU0NWZmYTJh
14
- NjQwZGY4ZTUxMTViNTZjMTllN2M5ZWYzZTI0MjIwYzgzZThlNTNkZjI0Nzhh
15
- OGRjZGQ1MDRlNThkOTJjMDc5YmQ5ODhmZDZhZGE1YzQzNWEzOTQ=
13
+ YTRkZDBkMjRkMzcwZmMxZTUzOTg4Mzg2YmYyYjVlOWU0ZGExZWM2ZjIxMzVk
14
+ MTU3ZjdlYTJiYjQwZjM0ODBkNjE4MTI3OWU4NjQ0NDBiMDkyNTA5NmU3NmJl
15
+ MDkyOWRhYzNiY2I3OTU3OGYwYmJiMWFjMWRiM2FlNjAxYTdmMGU=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- amazon-pricing (0.1.73)
4
+ amazon-pricing (0.1.74)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -20,7 +20,7 @@ module AwsPricing
20
20
  @_regions = {}
21
21
 
22
22
  # Creating regions upfront since different json files all use different naming conventions. No more ad-hoc creation.
23
- regions = ["eu-west-1", "sa-east-1", "us-east-1", "ap-northeast-1", "us-west-2", "us-west-1", "ap-southeast-1", "ap-southeast-2", "eu-central-1", "us-gov-west-1"]
23
+ regions = ["eu-west-1", "sa-east-1", "us-east-1", "ap-northeast-1", "us-west-2", "us-west-1", "ap-southeast-1", "ap-southeast-2", "eu-central-1", "us-gov-west-1", "ap-northeast-2"]
24
24
 
25
25
  regions.each do |name|
26
26
  @_regions[name] = Region.new(name)
@@ -8,5 +8,5 @@
8
8
  # Home:: http://github.com/CloudHealth/amazon-pricing
9
9
  #++
10
10
  module AwsPricing
11
- VERSION = '0.1.73'
11
+ VERSION = '0.1.74'
12
12
  end
@@ -1,23 +1,53 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe AwsPricing::ElastiCachePriceList do
4
+ NEW_REGIONS = ['ap-northeast-2']
4
5
  before(:all) do
5
6
  @pricing = AwsPricing::ElastiCachePriceList.new
6
7
  @node_types = [:memcached]
7
8
  end
9
+
10
+ def validate_price_in_region region
11
+ # Result have valid node name
12
+ expect(@node_types).to include(region.elasticache_node_types.first.category_types.first.name)
13
+ # values should not be nil
14
+ region.elasticache_node_types.first.category_types.first.ondemand_price_per_hour.should_not be_nil
15
+ # other prices per hour
16
+ region.elasticache_node_types.first.category_types.first.partialupfront_prepay_1_year.should_not be_nil
17
+ region.elasticache_node_types.first.category_types.first.partialupfront_prepay_3_year.should_not be_nil
18
+ region.elasticache_node_types.first.category_types.first.partialupfront_price_per_hour_1_year.should_not be_nil
19
+ region.elasticache_node_types.first.category_types.first.partialupfront_price_per_hour_3_year.should_not be_nil
20
+ end
21
+
22
+ def validate_breakeven_month_in_region region
23
+ region.elasticache_node_types.each do |node|
24
+ [:year1, :year3].each do |term|
25
+ [:partialupfront].each do |res_type|
26
+ [:memcached].each do |cache|
27
+ node.get_breakeven_month(cache, res_type, term).should_not be_nil
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
8
33
 
9
34
  describe 'new' do
10
35
  it 'ElastiCachePriceList.new should return the valid response' do
11
36
  @pricing.regions.each do |region|
12
- # Result have valid node name
13
- expect(@node_types).to include(region.elasticache_node_types.first.category_types.first.name)
14
- # values should not be nil
15
- region.elasticache_node_types.first.category_types.first.ondemand_price_per_hour.should_not be_nil
16
- # other prices per hour
17
- region.elasticache_node_types.first.category_types.first.partialupfront_prepay_1_year.should_not be_nil
18
- region.elasticache_node_types.first.category_types.first.partialupfront_prepay_3_year.should_not be_nil
19
- region.elasticache_node_types.first.category_types.first.partialupfront_price_per_hour_1_year.should_not be_nil
20
- region.elasticache_node_types.first.category_types.first.partialupfront_price_per_hour_3_year.should_not be_nil
37
+ next if NEW_REGIONS.include?(region.name)
38
+ validate_price_in_region region
39
+ end
40
+ end
41
+
42
+ it 'ElastiCachePriceList.new should not have price for new regions yet' do
43
+ @pricing.regions.each do |region|
44
+ next unless NEW_REGIONS.include?(region.name)
45
+ begin
46
+ validate_price_in_region region
47
+ fail
48
+ rescue RSpec::Expectations::ExpectationNotMetError => ex
49
+ # Success
50
+ end
21
51
  end
22
52
  end
23
53
  end
@@ -31,16 +61,21 @@ describe AwsPricing::ElastiCachePriceList do
31
61
  end
32
62
 
33
63
  describe 'get_breakeven_months' do
34
- it "test_fetch_all_breakeven_months" do
64
+ it "should return valid breakeven months" do
35
65
  @pricing.regions.each do |region|
36
- region.elasticache_node_types.each do |node|
37
- [:year1, :year3].each do |term|
38
- [:partialupfront].each do |res_type|
39
- [:memcached].each do |cache|
40
- node.get_breakeven_month(cache, res_type, term).should_not be_nil
41
- end
42
- end
43
- end
66
+ next if NEW_REGIONS.include?(region.name)
67
+ validate_breakeven_month_in_region region
68
+ end
69
+ end
70
+
71
+ it "should not yet have valid breakeven months for new region" do
72
+ @pricing.regions.each do |region|
73
+ next unless NEW_REGIONS.include?(region.name)
74
+ begin
75
+ validate_breakeven_month_in_region region
76
+ fail
77
+ rescue RSpec::Expectations::ExpectationNotMetError => ex
78
+ # Success
44
79
  end
45
80
  end
46
81
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon-pricing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.73
4
+ version: 0.1.74
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Kinsella
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-19 00:00:00.000000000 Z
11
+ date: 2016-02-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Ruby library for retrieving pricing for Amazon Web Services
14
14
  email:
@@ -96,4 +96,3 @@ test_files:
96
96
  - spec/support/.gitignore
97
97
  - test/ec2_instance_types_test.rb
98
98
  - test/helper.rb
99
- has_rdoc: