def test_that_when_deprecating_a_thing_type_fails_the_deprecate_thing_type_method_returns_error(self): ''' tests False when thing type fails to deprecate ''' self.conn.deprecate_thing_type.side_effect = ClientError(error_content, 'deprecate_thing_type') result = boto_iot.deprecate_thing_type(thingTypeName=thing_type_name, undoDeprecate=False, **conn_parameters) self.assertFalse(result.get('deprecated')) self.assertEqual(result.get('error', {}).get('message'), error_message.format('deprecate_thing_type'))
def test_that_when_deprecating_a_thing_type_succeeds_the_deprecate_thing_type_method_returns_true(self): ''' tests True when deprecate thing type succeeds ''' self.conn.deprecate_thing_type.return_value = {} result = boto_iot.deprecate_thing_type(thingTypeName=thing_type_name, undoDeprecate=False, **conn_parameters) self.assertTrue(result.get('deprecated')) self.assertEqual(result.get('error'), None)
def test_that_when_deprecating_a_thing_type_succeeds_the_deprecate_thing_type_method_returns_true( boto_conn): ''' tests True when deprecate thing type succeeds ''' boto_conn.deprecate_thing_type.return_value = {} result = boto_iot.deprecate_thing_type(thingTypeName=thing_type_name, undoDeprecate=False, **pytest.conn_parameters) assert result.get('deprecated') assert result.get('error') == None
def test_that_when_deprecating_a_thing_type_succeeds_the_deprecate_thing_type_method_returns_true( self, ): """ tests True when deprecate thing type succeeds """ self.conn.deprecate_thing_type.return_value = {} result = boto_iot.deprecate_thing_type( thingTypeName=thing_type_name, undoDeprecate=False, **conn_parameters ) assert result.get("deprecated") assert result.get("error") == None
def test_that_when_deprecating_a_thing_type_fails_the_deprecate_thing_type_method_returns_error( boto_conn): ''' tests False when thing type fails to deprecate ''' boto_conn.deprecate_thing_type.side_effect = exceptions.ClientError( error_content, 'deprecate_thing_type') result = boto_iot.deprecate_thing_type(thingTypeName=thing_type_name, undoDeprecate=False, **pytest.conn_parameters) assert not result.get('deprecated') assert result.get( 'error', {}).get('message') == error_message.format('deprecate_thing_type')
def test_that_when_deprecating_a_thing_type_fails_the_deprecate_thing_type_method_returns_error( self, ): """ tests False when thing type fails to deprecate """ self.conn.deprecate_thing_type.side_effect = ClientError( error_content, "deprecate_thing_type") result = boto_iot.deprecate_thing_type(thingTypeName=thing_type_name, undoDeprecate=False, **conn_parameters) self.assertFalse(result.get("deprecated")) self.assertEqual( result.get("error", {}).get("message"), error_message.format("deprecate_thing_type"), )