Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Unified Diff: third_party/gsutil/third_party/boto/tests/unit/ec2/test_reservedinstance.py

Issue 1377933002: [catapult] - Copy Telemetry's gsutilz over to third_party. (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Rename to gsutil. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/gsutil/third_party/boto/tests/unit/ec2/test_reservedinstance.py
diff --git a/third_party/gsutil/third_party/boto/tests/unit/ec2/test_reservedinstance.py b/third_party/gsutil/third_party/boto/tests/unit/ec2/test_reservedinstance.py
new file mode 100644
index 0000000000000000000000000000000000000000..c1ec688b92e3bdd3a86a64b3e28bb7fff42890b8
--- /dev/null
+++ b/third_party/gsutil/third_party/boto/tests/unit/ec2/test_reservedinstance.py
@@ -0,0 +1,44 @@
+from tests.unit import AWSMockServiceTestCase
+from boto.ec2.connection import EC2Connection
+from boto.ec2.reservedinstance import ReservedInstance
+
+
+class TestReservedInstancesSet(AWSMockServiceTestCase):
+ connection_class = EC2Connection
+
+ def default_body(self):
+ return b"""
+<reservedInstancesSet>
+ <item>
+ <reservedInstancesId>ididididid</reservedInstancesId>
+ <instanceType>t1.micro</instanceType>
+ <start>2014-05-03T14:10:10.944Z</start>
+ <end>2014-05-03T14:10:11.000Z</end>
+ <duration>64800000</duration>
+ <fixedPrice>62.5</fixedPrice>
+ <usagePrice>0.0</usagePrice>
+ <instanceCount>5</instanceCount>
+ <productDescription>Linux/UNIX</productDescription>
+ <state>retired</state>
+ <instanceTenancy>default</instanceTenancy>
+ <currencyCode>USD</currencyCode>
+ <offeringType>Heavy Utilization</offeringType>
+ <recurringCharges>
+ <item>
+ <frequency>Hourly</frequency>
+ <amount>0.005</amount>
+ </item>
+ </recurringCharges>
+ </item>
+</reservedInstancesSet>"""
+
+ def test_get_all_reserved_instaces(self):
+ self.set_http_response(status_code=200)
+ response = self.service_connection.get_all_reserved_instances()
+
+ self.assertEqual(len(response), 1)
+ self.assertTrue(isinstance(response[0], ReservedInstance))
+ self.assertEquals(response[0].id, 'ididididid')
+ self.assertEquals(response[0].instance_count, 5)
+ self.assertEquals(response[0].start, '2014-05-03T14:10:10.944Z')
+ self.assertEquals(response[0].end, '2014-05-03T14:10:11.000Z')

Powered by Google App Engine
This is Rietveld 408576698