amazon-pricing 0.1.73 → 0.1.74
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/lib/amazon-pricing/aws-price-list.rb +1 -1
- data/lib/amazon-pricing/version.rb +1 -1
- data/spec/lib/amazon-pricing/elasticache_pricing_spec.rb +53 -18
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzEzMzA5NjEyOTkzYzczNTZhYWVmZGYzMmYwZTdiZTNiMTQxYmQ2Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjViZDc3N2RkODA5MzdjYTBlZDQ4NWQ1MDlhZmNjNWQ2N2NhYzZjZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmIwYzdmNjc4NDQ4Y2VmYzAzMmRmNTFhMDJmZWE1NjVjNWE2MzgwZWRhMjcw
|
10
|
+
MWEwNDhhNjE0NzQzYTg4YjMxYWJlMWRkNWRmN2EyNjBjY2ZiOWZiZWMwYjA3
|
11
|
+
MTQ3NWZmOTUyNzlmMWZhN2E0YmFiODg3YjU1ZTVlYmY0Zjc5OTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTRkZDBkMjRkMzcwZmMxZTUzOTg4Mzg2YmYyYjVlOWU0ZGExZWM2ZjIxMzVk
|
14
|
+
MTU3ZjdlYTJiYjQwZjM0ODBkNjE4MTI3OWU4NjQ0NDBiMDkyNTA5NmU3NmJl
|
15
|
+
MDkyOWRhYzNiY2I3OTU3OGYwYmJiMWFjMWRiM2FlNjAxYTdmMGU=
|
data/Gemfile.lock
CHANGED
@@ -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)
|
@@ -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
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
region.
|
20
|
-
|
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 "
|
64
|
+
it "should return valid breakeven months" do
|
35
65
|
@pricing.regions.each do |region|
|
36
|
-
region.
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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.
|
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-
|
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:
|