| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 import datetime | 2 import datetime |
| 3 import xml.sax | 3 import xml.sax |
| 4 import unittest | 4 import unittest |
| 5 import boto.handler | 5 import boto.handler |
| 6 import boto.resultset | 6 import boto.resultset |
| 7 import boto.cloudformation | 7 import boto.cloudformation |
| 8 | 8 |
| 9 SAMPLE_XML = r""" | 9 SAMPLE_XML = r""" |
| 10 <DescribeStacksResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-1
5/"> | 10 <DescribeStacksResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-1
5/"> |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 self.assertEqual( | 194 self.assertEqual( |
| 195 timestamp_2, | 195 timestamp_2, |
| 196 datetime.datetime(2011, 3, 5, 19, 57, 58, 161616) | 196 datetime.datetime(2011, 3, 5, 19, 57, 58, 161616) |
| 197 ) | 197 ) |
| 198 timestamp_3 = rs[1].deletion_time | 198 timestamp_3 = rs[1].deletion_time |
| 199 self.assertEqual( | 199 self.assertEqual( |
| 200 timestamp_3, | 200 timestamp_3, |
| 201 datetime.datetime(2011, 3, 10, 16, 20, 51, 575757) | 201 datetime.datetime(2011, 3, 10, 16, 20, 51, 575757) |
| 202 ) | 202 ) |
| 203 | 203 |
| 204 def test_list_stacks_time_with_millis(self): | 204 def test_list_stacks_time_with_millis_again(self): |
| 205 rs = boto.resultset.ResultSet([ | 205 rs = boto.resultset.ResultSet([ |
| 206 ('member', boto.cloudformation.stack.StackResourceSummary) | 206 ('member', boto.cloudformation.stack.StackResourceSummary) |
| 207 ]) | 207 ]) |
| 208 h = boto.handler.XmlHandler(rs, None) | 208 h = boto.handler.XmlHandler(rs, None) |
| 209 xml.sax.parseString(LIST_STACK_RESOURCES_XML, h) | 209 xml.sax.parseString(LIST_STACK_RESOURCES_XML, h) |
| 210 timestamp_1 = rs[0].last_updated_time | 210 timestamp_1 = rs[0].last_updated_time |
| 211 self.assertEqual( | 211 self.assertEqual( |
| 212 timestamp_1, | 212 timestamp_1, |
| 213 datetime.datetime(2011, 6, 21, 20, 15, 58) | 213 datetime.datetime(2011, 6, 21, 20, 15, 58) |
| 214 ) | 214 ) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 rs = boto.resultset.ResultSet([('member', boto.cloudformation.stack.Stac
k)]) | 247 rs = boto.resultset.ResultSet([('member', boto.cloudformation.stack.Stac
k)]) |
| 248 h = boto.handler.XmlHandler(rs, None) | 248 h = boto.handler.XmlHandler(rs, None) |
| 249 sample_xml_upper = SAMPLE_XML.replace('false', 'True') | 249 sample_xml_upper = SAMPLE_XML.replace('false', 'True') |
| 250 xml.sax.parseString(sample_xml_upper, h) | 250 xml.sax.parseString(sample_xml_upper, h) |
| 251 disable_rollback = rs[0].disable_rollback | 251 disable_rollback = rs[0].disable_rollback |
| 252 self.assertTrue(disable_rollback) | 252 self.assertTrue(disable_rollback) |
| 253 | 253 |
| 254 | 254 |
| 255 if __name__ == '__main__': | 255 if __name__ == '__main__': |
| 256 unittest.main() | 256 unittest.main() |
| OLD | NEW |