def test_passing_engine(self): repo = self.tmp_repos() api.create(repo, 'temp') api.script('First Version', repo) engine = construct_engine('sqlite:///:memory:') api.version_control(engine, repo) api.upgrade(engine, repo)
def test_source(self): repo = self.tmp_repos() api.create(repo, 'temp') api.script('first version', repo) api.script_sql('default', 'desc', repo) # no repository self.assertRaises(UsageError, api.source, 1) # stdout out = api.source(1, dest=None, repository=repo) self.assertTrue(out) # file out = api.source(1, dest=self.tmp_repos(), repository=repo) self.assertFalse(out)
def _setup(self, url): super(TestSchemaAPI, self)._setup(url) self.repo = self.tmp_repos() api.create(self.repo, 'temp') self.schema = api.version_control(url, self.repo)
def test_version_control(self): repo = self.tmp_repos() api.create(repo, 'temp') api.version_control('sqlite:///', repo) api.version_control('sqlite:///', six.text_type(repo))
def test_version(self): repo = self.tmp_repos() api.create(repo, 'temp') api.version(repo)
def test_script_sql(self): repo = self.tmp_repos() api.create(repo, 'temp') api.script_sql('postgres', 'desc', repo)
def test_script(self): repo = self.tmp_repos() api.create(repo, 'temp') api.script('first version', repo)
def test_create(self): tmprepo = self.tmp_repos() api.create(tmprepo, 'temp') # repository already exists self.assertRaises(KnownError, api.create, tmprepo, 'temp')