def test_skunky_put_identity_dynamodb_raise_error(self, session_mock): dynamodb_table_mock = Mock() dynamodb_table_mock.put_item.side_effect = Exception( 'Some unknown exception') testSkunky = Skunky(session_mock) testSkunky.dynamodb_table = dynamodb_table_mock self.assertRaises(Exception, lambda: testSkunky.put(TEST_IDENTITY_1_A_US_WEST_2))
def test_skunky_put_identity_dynamodb_false(self, session_mock): response = {'Error': {'Code': "ConditionalCheckFailedException"}} dynamodb_table_mock = Mock() dynamodb_table_mock.put_item.side_effect = exceptions.ClientError( response, 'put_item') testSkunky = Skunky(session_mock) testSkunky.dynamodb_table = dynamodb_table_mock self.assertFalse(testSkunky.put(TEST_IDENTITY_1_A_US_WEST_2))