(self)
| 142 | self.assertEqual(str(err.exception), 'nearly out of space') |
| 143 | |
| 144 | def test_database_source_name(self): |
| 145 | with memory_database() as bck: |
| 146 | self.cx.backup(bck, name='main') |
| 147 | with memory_database() as bck: |
| 148 | self.cx.backup(bck, name='temp') |
| 149 | with self.assertRaises(sqlite.OperationalError) as cm: |
| 150 | with memory_database() as bck: |
| 151 | self.cx.backup(bck, name='non-existing') |
| 152 | self.assertIn("unknown database", str(cm.exception)) |
| 153 | |
| 154 | self.cx.execute("ATTACH DATABASE ':memory:' AS attached_db") |
| 155 | self.cx.execute('CREATE TABLE attached_db.foo (key INTEGER)') |
| 156 | self.cx.executemany('INSERT INTO attached_db.foo (key) VALUES (?)', [(3,), (4,)]) |
| 157 | self.cx.commit() |
| 158 | with memory_database() as bck: |
| 159 | self.cx.backup(bck, name='attached_db') |
| 160 | self.verify_backup(bck) |
| 161 | |
| 162 | |
| 163 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected