示例#1
0
 def test_that_when_creating_a_thing_type_fails_the_create_thing_type_method_returns_error(self):
     '''
     tests False when thing type not created
     '''
     self.conn.create_thing_type.side_effect = ClientError(error_content, 'create_thing_type')
     result = boto_iot.create_thing_type(thingTypeName=thing_type_name,
                                         thingTypeDescription=thing_type_desc,
                                         searchableAttributesList=[thing_type_attr_1],
                                         **conn_parameters)
     self.assertEqual(result.get('error', {}).get('message'), error_message.format('create_thing_type'))
示例#2
0
 def test_that_when_creating_a_thing_type_succeeds_the_create_thing_type_method_returns_true(self):
     '''
     tests True when thing type created
     '''
     self.conn.create_thing_type.return_value = create_thing_type_ret
     result = boto_iot.create_thing_type(thingTypeName=thing_type_name,
                                         thingTypeDescription=thing_type_desc,
                                         searchableAttributesList=[thing_type_attr_1],
                                         **conn_parameters)
     self.assertTrue(result['created'])
     self.assertTrue(result['thingTypeArn'], thing_type_arn)
 def test_that_when_creating_a_thing_type_fails_the_create_thing_type_method_returns_error(
     self,
 ):
     """
     tests False when thing type not created
     """
     self.conn.create_thing_type.side_effect = ClientError(error_content, "create_thing_type")
     result = boto_iot.create_thing_type(
         thingTypeName=thing_type_name,
         thingTypeDescription=thing_type_desc,
         searchableAttributesList=[thing_type_attr_1],
         **conn_parameters
     )
     assert result.get("error", {}).get("message") == error_message.format("create_thing_type")
 def test_that_when_creating_a_thing_type_succeeds_the_create_thing_type_method_returns_true(
     self,
 ):
     """
     tests True when thing type created
     """
     self.conn.create_thing_type.return_value = create_thing_type_ret
     result = boto_iot.create_thing_type(
         thingTypeName=thing_type_name,
         thingTypeDescription=thing_type_desc,
         searchableAttributesList=[thing_type_attr_1],
         **conn_parameters
     )
     assert result["created"]
     assert result["thingTypeArn"], thing_type_arn