~ubuntu-branches/ubuntu/wily/python-boto/wily-proposed

« back to all changes in this revision

Viewing changes to tests/unit/emr/test_connection.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-07-09 16:11:38 UTC
  • mfrom: (19.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20150709161138-1tiv60tdcbnpex33
Tags: 2.38.0-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  * d/tests/unit: Fix autopkgtest error in test_timeout.
  * d/tests/unit: run tests/test.py with each python in 'pyversions -i'

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
from boto.emr.connection import EmrConnection
29
29
from boto.emr.emrobject import BootstrapAction, BootstrapActionList, \
30
 
                               ClusterStatus, ClusterSummaryList, \
 
30
                               ClusterStateChangeReason, ClusterStatus, ClusterSummaryList, \
31
31
                               ClusterSummary, ClusterTimeline, InstanceInfo, \
32
32
                               InstanceList, InstanceGroupInfo, \
33
33
                               InstanceGroup, InstanceGroupList, JobFlow, \
62
62
          </Timeline>
63
63
        </Status>
64
64
        <Name>analytics test</Name>
 
65
        <NormalizedInstanceHours>10</NormalizedInstanceHours>
65
66
      </member>
66
67
      <member>
67
68
        <Id>j-aaaaaaaaaaaab</Id>
78
79
          </Timeline>
79
80
        </Status>
80
81
        <Name>test job</Name>
 
82
        <NormalizedInstanceHours>20</NormalizedInstanceHours>
81
83
      </member>
82
84
    </Clusters>
83
85
  </ListClustersResult>
99
101
        self.assertTrue(isinstance(response, ClusterSummaryList))
100
102
 
101
103
        self.assertEqual(len(response.clusters), 2)
 
104
 
102
105
        self.assertTrue(isinstance(response.clusters[0], ClusterSummary))
103
106
        self.assertEqual(response.clusters[0].name, 'analytics test')
 
107
        self.assertEqual(response.clusters[0].normalizedinstancehours, '10')
104
108
 
105
109
        self.assertTrue(isinstance(response.clusters[0].status, ClusterStatus))
 
110
        self.assertEqual(response.clusters[0].status.state, 'TERMINATED')
106
111
 
107
112
        self.assertTrue(isinstance(response.clusters[0].status.timeline, ClusterTimeline))
108
113
 
110
115
        self.assertEqual(response.clusters[0].status.timeline.readydatetime, '2014-01-24T01:25:26Z')
111
116
        self.assertEqual(response.clusters[0].status.timeline.enddatetime, '2014-01-24T02:19:46Z')
112
117
 
 
118
        self.assertTrue(isinstance(response.clusters[0].status.statechangereason, ClusterStateChangeReason))
 
119
        self.assertEqual(response.clusters[0].status.statechangereason.code, 'USER_REQUEST')
 
120
        self.assertEqual(response.clusters[0].status.statechangereason.message, 'Terminated by user request')
113
121
 
114
122
    def test_list_clusters_created_before(self):
115
123
        self.set_http_response(status_code=200)
558
566
        </member>
559
567
      </Applications>
560
568
      <TerminationProtected>false</TerminationProtected>
 
569
      <MasterPublicDnsName>ec2-184-0-0-1.us-west-1.compute.amazonaws.com</MasterPublicDnsName>
 
570
      <NormalizedInstanceHours>10</NormalizedInstanceHours>
 
571
      <ServiceRole>my-service-role</ServiceRole>
561
572
    </Cluster>
562
573
  </DescribeClusterResult>
563
574
  <ResponseMetadata>
587
598
        self.assertEqual(response.status.state, 'TERMINATED')
588
599
        self.assertEqual(response.applications[0].name, 'hadoop')
589
600
        self.assertEqual(response.applications[0].version, '1.0.3')
 
601
        self.assertEqual(response.masterpublicdnsname, 'ec2-184-0-0-1.us-west-1.compute.amazonaws.com')
 
602
        self.assertEqual(response.normalizedinstancehours, '10')
 
603
        self.assertEqual(response.servicerole, 'my-service-role')
590
604
 
591
605
        self.assert_request_parameters({
592
606
            'Action': 'DescribeCluster',