|
36 | 36 |
|
37 | 37 | from google.cloud._helpers import UTC
|
38 | 38 | from google.cloud.exceptions import GrpcRendezvous
|
39 |
| -from google.cloud.exceptions import NotFound |
40 | 39 | from google.cloud.spanner_v1._helpers import TimestampWithNanoseconds
|
41 | 40 | from google.cloud.spanner import Client
|
42 | 41 | from google.cloud.spanner import KeyRange
|
@@ -283,17 +282,18 @@ def test_create_database(self):
|
283 | 282 | for database in Config.INSTANCE.list_databases()]
|
284 | 283 | self.assertIn(temp_db_id, database_ids)
|
285 | 284 |
|
286 |
| - def test_create_database_not_found(self): |
287 |
| - temp_db_id = 'temp_db' + unique_resource_id('_') |
| 285 | + def test_table_not_found(self): |
| 286 | + table = 'yTable' |
288 | 287 | temp_db = Config.INSTANCE.database(temp_db_id, ddl_statements=[
|
289 | 288 | 'CREATE TABLE MyTable ('
|
290 | 289 | ' Id STRING(36) NOT NULL,'
|
291 | 290 | ' Field1 STRING(36) NOT NULL'
|
292 | 291 | ') PRIMARY KEY (Id)',
|
293 |
| - 'CREATE INDEX IDX ON yTable (Field1)' |
| 292 | + 'CREATE INDEX IDX ON {table} (Field1)'.format(table) |
294 | 293 | ])
|
295 |
| - with self.assertRaisesRegexp(NotFound, 'Database not found: ' + temp_db_id): |
296 |
| - operation = temp_db.create() |
| 294 | + with self.assertRaisesRegexp(GrpcRendezvous, |
| 295 | + 'Table not found: {table}'.format(table)): |
| 296 | + operation = temp_db.create() |
297 | 297 |
|
298 | 298 | def test_update_database_ddl(self):
|
299 | 299 | pool = BurstyPool()
|
|
0 commit comments