amazon-pricing 0.1.51 → 0.1.52
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 +8 -8
- data/lib/amazon-pricing/category-type.rb +5 -5
- data/lib/amazon-pricing/version.rb +1 -1
- data/test/ec2_instance_types_test.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjhmYmJjYTBkNmVmYzk3NWUwM2FhZTk4ZTFhZGQ4MjM5NTg1YWE0Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzdlMjYwNWRlMDBhZDA4ZWUxY2RmOWFhY2NhMjU4ZmRiYTA4NmMyNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTI2ZGQwZGRiZjUxNjEyNDlhZTkwMWM5MmI5NjAzM2RlMDAxZTFlZTY0OTAw
|
10
|
+
NTY1YTZmMWJiZmUwNWM3N2MwMjZmODlmZjNjYTIxYmJhNDllOGNkNTEzMTEx
|
11
|
+
Y2QxOTI3OGZlODUyOTdhZjIyZWQxZjE3MDljM2QzYTIwZTljNTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTY1NTI5MWE5Njg1Y2VhYjA0MmJiNDcwYTM1MjMzZDdlMTEzNThmZWQ4YTU2
|
14
|
+
MmE1MmJjMTI2NDQ0NjFjNDM4MjhmMjg0YjQ3Y2I5YzI0NjI0MjRkYjhmN2Jj
|
15
|
+
NTYwZGIxNDliMGU3ZjBkOGFiNzExNDBjMGRlMzczZTIyNTVmYjI=
|
@@ -19,23 +19,23 @@ module AwsPricing
|
|
19
19
|
:noupfront_price_per_hour_1_year, :noupfront_price_per_hour_3_year
|
20
20
|
|
21
21
|
def allupfront_effective_rate_1_year
|
22
|
-
allupfront_prepay_1_year / 365 / 24
|
22
|
+
(allupfront_prepay_1_year / 365 / 24).round(4)
|
23
23
|
end
|
24
24
|
|
25
25
|
def allupfront_effective_rate_3_year
|
26
|
-
allupfront_prepay_3_year / 3 / 365 / 24
|
26
|
+
(allupfront_prepay_3_year / 3 / 365 / 24).round(4)
|
27
27
|
end
|
28
28
|
|
29
29
|
def partialupfront_effective_rate_1_year
|
30
|
-
partialupfront_prepay_1_year / 365 / 24 + partialupfront_price_per_hour_1_year
|
30
|
+
(partialupfront_prepay_1_year / 365 / 24 + partialupfront_price_per_hour_1_year).round(4)
|
31
31
|
end
|
32
32
|
|
33
33
|
def partialupfront_effective_rate_3_year
|
34
|
-
partialupfront_prepay_3_year / 3 / 365 / 24 + partialupfront_price_per_hour_3_year
|
34
|
+
(partialupfront_prepay_3_year / 3 / 365 / 24 + partialupfront_price_per_hour_3_year).round(4)
|
35
35
|
end
|
36
36
|
|
37
37
|
def noupfront_effective_rate_1_year
|
38
|
-
noupfront_price_per_hour_1_year
|
38
|
+
(noupfront_price_per_hour_1_year).round(4)
|
39
39
|
end
|
40
40
|
|
41
41
|
def initialize(instance_type=nil, name=nil)
|
@@ -112,11 +112,11 @@ class TestEc2InstanceTypes < Test::Unit::TestCase
|
|
112
112
|
assert os.allupfront_prepay_1_year == 542
|
113
113
|
assert os.partialupfront_prepay_3_year == 508
|
114
114
|
assert os.allupfront_prepay_3_year == 1020
|
115
|
-
assert os.noupfront_effective_rate_1_year
|
116
|
-
assert os.partialupfront_effective_rate_1_year
|
117
|
-
assert os.allupfront_effective_rate_1_year
|
118
|
-
assert os.partialupfront_effective_rate_3_year
|
119
|
-
assert os.allupfront_effective_rate_3_year
|
115
|
+
assert os.noupfront_effective_rate_1_year == 0.0730
|
116
|
+
assert os.partialupfront_effective_rate_1_year == 0.0632
|
117
|
+
assert os.allupfront_effective_rate_1_year == 0.0619
|
118
|
+
assert os.partialupfront_effective_rate_3_year == 0.0413
|
119
|
+
assert os.allupfront_effective_rate_3_year == 0.0388
|
120
120
|
end
|
121
121
|
|
122
122
|
def test_bad_data
|