Example #1
0
    def setup(self):
        """Creates a test environment."""

        if os.path.exists(path.join('test_output', 'gh.sqlite')):
            os.unlink(path.join('test_output', 'gh.sqlite'));

        with open(path.join('test_output', 'config.ini'), 'w') as file:
            file.write(SQLA_TRACK_CONFIG)

        refresh_engine()
        self.app = make_app(self.setup_app, 'test_output')
        data_init()
        # Bind the model to the new engine

        Author.metadata.bind = get_engine()
Example #2
0
def init_data(app):
    engine = get_engine()
    metadata.create_all(engine)