예제 #1
0
 def test_zero_nonempty(self) -> None:
     self.conn.cursor().execute("create table x (x int primary key)")
     with self.assertRaises(dbver.VersionError):
         dbver.check_application_id(1, self.conn)
     with self.assertRaises(dbver.VersionError):
         dbver.check_application_id(1, self.conn, "main")
예제 #2
0
 def test_zero_nonempty_other(self) -> None:
     self.conn.cursor().execute('create table "other schema".x '
                                "(x int primary key)")
     with self.assertRaises(dbver.VersionError):
         dbver.check_application_id(1, self.conn, "other schema")
예제 #3
0
 def test_unexpected_other(self) -> None:
     self.conn.cursor().execute('pragma "other schema".application_id = 2')
     with self.assertRaises(dbver.VersionError):
         dbver.check_application_id(1, self.conn, "other schema")
예제 #4
0
 def test_unprovisioned(self) -> None:
     dbver.check_application_id(1, self.conn)
     dbver.check_application_id(1, self.conn, "main")
     dbver.check_application_id(1, self.conn, "other schema")
예제 #5
0
 def test_unexpected(self) -> None:
     self.conn.cursor().execute("pragma application_id = 2")
     with self.assertRaises(dbver.VersionError):
         dbver.check_application_id(1, self.conn)
     with self.assertRaises(dbver.VersionError):
         dbver.check_application_id(1, self.conn, "main")
예제 #6
0
 def test_expected_nonempty_other(self) -> None:
     self.conn.cursor().execute('pragma "other schema".application_id = 1')
     self.conn.cursor().execute('create table "other schema".x '
                                "(x int primary key)")
     dbver.check_application_id(1, self.conn, "other schema")
예제 #7
0
 def test_expected_nonempty(self) -> None:
     self.conn.cursor().execute("pragma application_id = 1")
     self.conn.cursor().execute("create table x (x int primary key)")
     dbver.check_application_id(1, self.conn)
     dbver.check_application_id(1, self.conn, "main")
예제 #8
0
 def test_expected_empty_other(self) -> None:
     self.conn.cursor().execute('pragma "other schema".application_id = 1')
     dbver.check_application_id(1, self.conn, "other schema")
예제 #9
0
 def test_expected_empty(self) -> None:
     self.conn.cursor().execute("pragma application_id = 1")
     dbver.check_application_id(1, self.conn)
     dbver.check_application_id(1, self.conn, "main")