Skip to content

Commit 126c3fb

Browse files
authored
Prep firestore unit tests for generation from 'v1' protos. (#7437)
1 parent f9ad2ef commit 126c3fb

File tree

236 files changed

+19
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+19
-6
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2017 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
File renamed without changes.
File renamed without changes.

firestore/tests/unit/test_client.py renamed to firestore/tests/unit/v1beta1/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ class TestClient(unittest.TestCase):
2525

2626
@staticmethod
2727
def _get_target_class():
28-
from google.cloud import firestore
28+
from google.cloud.firestore_v1beta1.client import Client
2929

30-
return firestore.Client
30+
return Client
3131

3232
def _make_one(self, *args, **kwargs):
3333
klass = self._get_target_class()
File renamed without changes.

firestore/tests/unit/test_cross_language.py renamed to firestore/tests/unit/v1beta1/test_cross_language.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ def _load_testproto(filename):
3737
return test_proto
3838

3939

40-
ALL_TESTPROTOS = [
41-
_load_testproto(filename)
42-
for filename in sorted(glob.glob("tests/unit/testdata/*.textproto"))
43-
]
40+
_here = os.path.dirname(__file__)
41+
_glob_expr = "{}/testdata/*.textproto".format(_here)
42+
_globs = glob.glob(_glob_expr)
43+
ALL_TESTPROTOS = [_load_testproto(filename) for filename in sorted(_globs)]
4444

4545
_CREATE_TESTPROTOS = [
4646
test_proto
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)