Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
 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)
Beispiel #4
0
 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))
Beispiel #5
0
 def test_version(self):
     repo = self.tmp_repos()
     api.create(repo, 'temp')
     api.version(repo)
Beispiel #6
0
 def test_script_sql(self):
     repo = self.tmp_repos()
     api.create(repo, 'temp')
     api.script_sql('postgres', 'desc', repo)
Beispiel #7
0
 def test_script(self):
     repo = self.tmp_repos()
     api.create(repo, 'temp')
     api.script('first version', repo)
Beispiel #8
0
    def test_create(self):
        tmprepo = self.tmp_repos()
        api.create(tmprepo, 'temp')

        # repository already exists
        self.assertRaises(KnownError, api.create, tmprepo, 'temp')