# Path: pyrseas/testutils.py
# class AugmentToMapTestCase(PyrseasTestCase):
# 
#     def to_map(self, stmts, augmap):
#         """Apply an augment map and return a map of the updated database.
# 
#         :param stmts: list of SQL statements to execute
#         :param augmap: dictionary describing the augmentations
#         :return: dictionary of the updated database
#         """
#         for stmt in stmts:
#             self.db.execute(stmt)
#         self.db.conn.commit()
#         self.config_options(schemas=[], tables=[], no_owner=True,
#                             no_privs=True, multiple_files=False)
#         db = AugmentDatabase(self.cfg)
#         return db.apply(augmap)


import pytest
from pyrseas.testutils import AugmentToMapTestCase
# -*- coding: utf-8 -*-
"""Test audit columns"""



CREATE_STMT = "CREATE TABLE t1 (c1 integer, c2 text)"
FUNC_SRC1 = """
BEGIN
  NEW.modified_by_user = SESSION_USER;
  NEW.modified_timestamp = CURRENT_TIMESTAMP;
  RETURN NEW;
END"""

FUNC_SRC2 = """
BEGIN
  NEW.updated = CURRENT_TIMESTAMP;
  RETURN NEW;
END"""



# Path: pyrseas/testutils.py
# class AugmentToMapTestCase(PyrseasTestCase):
# 
#     def to_map(self, stmts, augmap):
#         """Apply an augment map and return a map of the updated database.
# 
#         :param stmts: list of SQL statements to execute
#         :param augmap: dictionary describing the augmentations
#         :return: dictionary of the updated database
#         """
#         for stmt in stmts:
#             self.db.execute(stmt)
#         self.db.conn.commit()
#         self.config_options(schemas=[], tables=[], no_owner=True,
#                             no_privs=True, multiple_files=False)
#         db = AugmentDatabase(self.cfg)
#         return db.apply(augmap)


# Path: tests/augment/test_audit.py
import pytest
from pyrseas.testutils import AugmentToMapTestCase

# -*- coding: utf-8 -*-
"""Test audit columns"""



CREATE_STMT = "CREATE TABLE t1 (c1 integer, c2 text)"
FUNC_SRC1 = """
BEGIN
  NEW.modified_by_user = SESSION_USER;
  NEW.modified_timestamp = CURRENT_TIMESTAMP;
  RETURN NEW;
END"""

FUNC_SRC2 = """
BEGIN
  NEW.updated = CURRENT_TIMESTAMP;
  RETURN NEW;
END"""



class AuditColumnsTestCase(AugmentToMapTestCase):