Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spanner: Database not found #4557

Merged
merged 3 commits into from
Dec 20, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Final review pass.
Using `assertRaises` instead of a `self.fail()` branch that
will never get triggered.

Also moving around imports in `google.cloud.spanner_v1.database`
to be alphabetical / separated by 1st-party and 3rd-party.
dhermes committed Dec 20, 2017

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
commit 9c627775ecc0ee22b1c8c2da894bc9742a2e6755
8 changes: 4 additions & 4 deletions spanner/google/cloud/spanner_v1/database.py
Original file line number Diff line number Diff line change
@@ -17,20 +17,20 @@
import re
import threading

import google.auth.credentials
from google.api_core import exceptions
import google.auth.credentials
from google.cloud.exceptions import Conflict
from google.cloud.exceptions import NotFound
from google.gax.errors import GaxError
from google.gax.grpc import exc_to_code
from google.cloud.spanner_v1.gapic.spanner_client import SpannerClient
from grpc import StatusCode
import six

# pylint: disable=ungrouped-imports
from google.cloud.exceptions import Conflict
from google.cloud.exceptions import NotFound
from google.cloud.spanner_v1 import __version__
from google.cloud.spanner_v1._helpers import _options_with_prefix
from google.cloud.spanner_v1.batch import Batch
from google.cloud.spanner_v1.gapic.spanner_client import SpannerClient
from google.cloud.spanner_v1.pool import BurstyPool
from google.cloud.spanner_v1.pool import SessionCheckout
from google.cloud.spanner_v1.session import Session
10 changes: 4 additions & 6 deletions spanner/tests/system/test_system.py
Original file line number Diff line number Diff line change
@@ -304,13 +304,11 @@ def test_table_not_found(self):
index,
],
)
try:
with self.assertRaises(NotFound) as exc_info:
temp_db.create()
except NotFound as exc:
self.assertEqual(exc.args[0],
'Table not found: {0}'.format(incorrect_table))
except:
self.fail()

expected = 'Table not found: {0}'.format(incorrect_table)
self.assertEqual(exc_info.exception.args, (expected,))

def test_update_database_ddl(self):
pool = BurstyPool()