Skip to content

Commit

Permalink
fix: drop v1beta1 from generation
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox committed Jul 14, 2020
1 parent cc25d5e commit 2c277a9
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 222 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ class FirestoreAdminAsyncClient:
DEFAULT_ENDPOINT = FirestoreAdminClient.DEFAULT_ENDPOINT
DEFAULT_MTLS_ENDPOINT = FirestoreAdminClient.DEFAULT_MTLS_ENDPOINT

index_path = staticmethod(FirestoreAdminClient.index_path)

field_path = staticmethod(FirestoreAdminClient.field_path)

index_path = staticmethod(FirestoreAdminClient.index_path)

from_service_account_file = FirestoreAdminClient.from_service_account_file
from_service_account_json = from_service_account_file

Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def cover(session):
test runs (not system test runs), and then erases coverage data.
"""
session.install("coverage", "pytest-cov")
session.run("coverage", "report", "--show-missing")
session.run("coverage", "report", "--show-missing", "--fail-under=100")

session.run("coverage", "erase")

Expand Down
189 changes: 0 additions & 189 deletions scripts/fixup_firestore_v1beta1_keywords.py

This file was deleted.

21 changes: 10 additions & 11 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@
"git": {
"name": ".",
"remote": "[email protected]:crwilcox/python-firestore.git",
"sha": "add6c506b948f9425f7eed2a4691700821f991d2"
"sha": "cc25d5ebfb8cc39b63bff2383e81d16793d42b20"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "5099a037c974066832474771c5dfab504b8daaf6",
"internalRef": "321186647"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b"
"sha": "3a89215abd0e66dfc4f21d07d552d0b543abf082"
}
}
],
"destinations": [
{
"client": {
"source": "googleapis",
"apiName": "firestore",
"apiVersion": "v1beta1",
"language": "python",
"generator": "gapic-generator-python"
}
},
{
"client": {
"source": "googleapis",
Expand Down
2 changes: 1 addition & 1 deletion synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

gapic = gcp.GAPICMicrogenerator()
common = gcp.CommonTemplates()
versions = ["v1beta1", "v1"]
versions = ["v1"]
admin_versions = ["v1"]


Expand Down
36 changes: 18 additions & 18 deletions tests/unit/gapic/admin_v1/test_firestore_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2601,55 +2601,55 @@ def test_firestore_admin_grpc_lro_async_client():
assert transport.operations_client is transport.operations_client


def test_index_path():
def test_field_path():
project = "squid"
database = "clam"
collection = "whelk"
index = "octopus"
field = "octopus"

expected = "projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}".format(
project=project, database=database, collection=collection, index=index,
expected = "projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}".format(
project=project, database=database, collection=collection, field=field,
)
actual = FirestoreAdminClient.index_path(project, database, collection, index)
actual = FirestoreAdminClient.field_path(project, database, collection, field)
assert expected == actual


def test_parse_index_path():
def test_parse_field_path():
expected = {
"project": "oyster",
"database": "nudibranch",
"collection": "cuttlefish",
"index": "mussel",
"field": "mussel",
}
path = FirestoreAdminClient.index_path(**expected)
path = FirestoreAdminClient.field_path(**expected)

# Check that the path construction is reversible.
actual = FirestoreAdminClient.parse_index_path(path)
actual = FirestoreAdminClient.parse_field_path(path)
assert expected == actual


def test_field_path():
def test_index_path():
project = "squid"
database = "clam"
collection = "whelk"
field = "octopus"
index = "octopus"

expected = "projects/{project}/databases/{database}/collectionGroups/{collection}/fields/{field}".format(
project=project, database=database, collection=collection, field=field,
expected = "projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}".format(
project=project, database=database, collection=collection, index=index,
)
actual = FirestoreAdminClient.field_path(project, database, collection, field)
actual = FirestoreAdminClient.index_path(project, database, collection, index)
assert expected == actual


def test_parse_field_path():
def test_parse_index_path():
expected = {
"project": "oyster",
"database": "nudibranch",
"collection": "cuttlefish",
"field": "mussel",
"index": "mussel",
}
path = FirestoreAdminClient.field_path(**expected)
path = FirestoreAdminClient.index_path(**expected)

# Check that the path construction is reversible.
actual = FirestoreAdminClient.parse_field_path(path)
actual = FirestoreAdminClient.parse_index_path(path)
assert expected == actual
Empty file.

0 comments on commit 2c277a9

Please sign in to comment.