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

Unified Diff: third_party/gsutil/boto/tests/unit/cloudformation/test_stack.py

Issue 12317103: Added gsutil to depot tools (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: added readme Created 7 years, 10 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/boto/tests/unit/cloudformation/test_stack.py
diff --git a/third_party/gsutil/boto/tests/unit/cloudformation/test_stack.py b/third_party/gsutil/boto/tests/unit/cloudformation/test_stack.py
new file mode 100644
index 0000000000000000000000000000000000000000..4f0db6aab1691c6e64e6124a7ca3bbd3b36f2ee4
--- /dev/null
+++ b/third_party/gsutil/boto/tests/unit/cloudformation/test_stack.py
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+import xml.sax
+import unittest
+import boto.handler
+import boto.resultset
+import boto.cloudformation
+
+SAMPLE_XML = r"""
+<DescribeStacksResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
+ <DescribeStacksResult>
+ <Stacks>
+ <member>
+ <Tags>
+ <member>
+ <Value>value0</Value>
+ <Key>key0</Key>
+ </member>
+ <member>
+ <Key>key1</Key>
+ <Value>value1</Value>
+ </member>
+ </Tags>
+ <StackId>arn:aws:cloudformation:ap-southeast-1:100:stack/Name/id</StackId>
+ <StackStatus>CREATE_COMPLETE</StackStatus>
+ <StackName>Name</StackName>
+ <StackStatusReason/>
+ <Description/>
+ <NotificationARNs>
+ <member>arn:aws:sns:ap-southeast-1:100:name</member>
+ </NotificationARNs>
+ <CreationTime>2013-01-10T05:04:56Z</CreationTime>
+ <DisableRollback>false</DisableRollback>
+ <Outputs>
+ <member>
+ <OutputValue>value0</OutputValue>
+ <Description>output0</Description>
+ <OutputKey>key0</OutputKey>
+ </member>
+ <member>
+ <OutputValue>value1</OutputValue>
+ <Description>output1</Description>
+ <OutputKey>key1</OutputKey>
+ </member>
+ </Outputs>
+ </member>
+ </Stacks>
+ </DescribeStacksResult>
+ <ResponseMetadata>
+ <RequestId>1</RequestId>
+ </ResponseMetadata>
+</DescribeStacksResponse>
+"""
+
+class TestStackParse(unittest.TestCase):
+ def test_parse_tags(self):
+ rs = boto.resultset.ResultSet([('member', boto.cloudformation.stack.Stack)])
+ h = boto.handler.XmlHandler(rs, None)
+ xml.sax.parseString(SAMPLE_XML, h)
+ tags = rs[0].tags
+ self.assertEqual(tags, {u'key0': u'value0', u'key1': u'value1'})
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698