def test_that_when_describing_thing_type_and_thing_type_does_not_exists_the_describe_thing_type_method_returns_none(self): ''' Tests describe thing type for an non existent thing type ''' self.conn.describe_thing_type.side_effect = not_found_error result = boto_iot.describe_thing_type(thingTypeName='non existent thing type', **conn_parameters) self.assertEqual(result.get('thing_type'), None)
def test_that_when_describing_thing_type_and_thing_type_exists_the_describe_thing_type_method_returns_thing_type(self): ''' Tests describe thing type for an existing thing type ''' self.conn.describe_thing_type.return_value = thing_type_ret result = boto_iot.describe_thing_type(thingTypeName=thing_type_name, **conn_parameters) self.assertEqual(result.get('thing_type'), thing_type_ret)
def test_that_when_describing_thing_type_and_boto3_returns_error_an_error_the_describe_thing_type_method_returns_error( self, ): self.conn.describe_thing_type.side_effect = ClientError( error_content, "describe_thing_type" ) result = boto_iot.describe_thing_type(thingTypeName="mythingtype", **conn_parameters) assert result.get("error", {}).get("message") == error_message.format("describe_thing_type")
def test_that_when_describing_thing_type_and_boto3_returns_error_an_error_the_describe_thing_type_method_returns_error( self): self.conn.describe_thing_type.side_effect = ClientError( error_content, 'describe_thing_type') result = boto_iot.describe_thing_type(thingTypeName='mythingtype', **conn_parameters) self.assertEqual( result.get('error', {}).get('message'), error_message.format('describe_thing_type'))
def test_that_when_describing_thing_type_and_thing_type_exists_the_describe_thing_type_method_returns_thing_type( self, ): """ Tests describe thing type for an existing thing type """ self.conn.describe_thing_type.return_value = thing_type_ret result = boto_iot.describe_thing_type(thingTypeName=thing_type_name, **conn_parameters) assert result.get("thing_type") == thing_type_ret
def test_that_when_describing_thing_type_and_boto3_returns_error_an_error_the_describe_thing_type_method_returns_error( boto_conn): boto_conn.describe_thing_type.side_effect = exceptions.ClientError( error_content, 'describe_thing_type') result = boto_iot.describe_thing_type(thingTypeName='mythingtype', **pytest.conn_parameters) assert result.get( 'error', {}).get('message') == error_message.format('describe_thing_type')
def test_that_when_describing_thing_type_and_thing_type_does_not_exists_the_describe_thing_type_method_returns_none( boto_conn): ''' Tests describe thing type for an non existent thing type ''' boto_conn.describe_thing_type.side_effect = not_found_error result = boto_iot.describe_thing_type( thingTypeName='non existent thing type', **pytest.conn_parameters) assert result.get('thing_type') == None
def test_that_when_describing_thing_type_and_thing_type_exists_the_describe_thing_type_method_returns_thing_type( boto_conn): ''' Tests describe thing type for an existing thing type ''' boto_conn.describe_thing_type.return_value = thing_type_ret result = boto_iot.describe_thing_type(thingTypeName=thing_type_name, **pytest.conn_parameters) assert result.get('thing_type') == thing_type_ret
def test_that_when_describing_thing_type_and_thing_type_does_not_exists_the_describe_thing_type_method_returns_none( self, ): """ Tests describe thing type for an non existent thing type """ self.conn.describe_thing_type.side_effect = not_found_error result = boto_iot.describe_thing_type( thingTypeName="non existent thing type", **conn_parameters ) assert result.get("thing_type") == None