|
1 | | -# Copyright 2020, Google, Inc. |
| 1 | +# Copyright 2020 Google, Inc. |
| 2 | +# |
2 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
3 | 4 | # you may not use this file except in compliance with the License. |
4 | 5 | # You may obtain a copy of the License at |
5 | 6 | # |
6 | | -# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
7 | 8 | # |
8 | 9 | # Unless required by applicable law or agreed to in writing, software |
9 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
|
27 | 28 | class TestFirestoreAsyncClient(firestore.AsyncClient): |
28 | 29 | def __init__(self, *args, **kwargs): |
29 | 30 | self._UNIQUE_STRING = UNIQUE_STRING |
30 | | - self._super = super(TestFirestoreAsyncClient, self) |
| 31 | + self._super = super() |
31 | 32 | self._super.__init__(*args, **kwargs) |
32 | 33 |
|
33 | 34 | def collection(self, collection_name, *args, **kwargs): |
34 | | - collection_name += "-{}".format(self._UNIQUE_STRING) |
| 35 | + collection_name += f"-{self._UNIQUE_STRING}" |
35 | 36 | return self._super.collection(collection_name, *args, **kwargs) |
36 | 37 |
|
37 | 38 |
|
@@ -172,7 +173,7 @@ async def test_update_multiple(): |
172 | 173 |
|
173 | 174 |
|
174 | 175 | async def test_update_server_timestamp(db): |
175 | | - await db.collection(u"objects").document(u"some-id").set({"timestamp": 0}) |
| 176 | + await db.collection("objects").document("some-id").set({"timestamp": 0}) |
176 | 177 | await snippets.update_server_timestamp() |
177 | 178 |
|
178 | 179 |
|
@@ -294,13 +295,13 @@ async def test_delete_full_collection(): |
294 | 295 | # TODO: b/132092178 |
295 | 296 | async def test_collection_group_query(db): |
296 | 297 | museum_docs = await snippets.collection_group_query(db) |
297 | | - names = set([museum.name for museum in museum_docs]) |
| 298 | + names = {museum.name for museum in museum_docs} |
298 | 299 | assert names == { |
299 | | - u"Legion of Honor", |
300 | | - u"The Getty", |
301 | | - u"National Air and Space Museum", |
302 | | - u"National Museum of Nature and Science", |
303 | | - u"Beijing Ancient Observatory", |
| 300 | + "Legion of Honor", |
| 301 | + "The Getty", |
| 302 | + "National Air and Space Museum", |
| 303 | + "National Museum of Nature and Science", |
| 304 | + "Beijing Ancient Observatory", |
304 | 305 | } |
305 | 306 |
|
306 | 307 |
|
|
0 commit comments