Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit 921553c

Browse files
authored
style: replace potentially disrespectful terms and language (#378)
1 parent d35ab35 commit 921553c

File tree

7 files changed

+93
-93
lines changed

7 files changed

+93
-93
lines changed

google/cloud/storage/blob.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2684,13 +2684,13 @@ def create_resumable_upload_session(
26842684
extra_headers["Origin"] = origin
26852685

26862686
try:
2687-
dummy_stream = BytesIO(b"")
2687+
fake_stream = BytesIO(b"")
26882688
# Send a fake the chunk size which we **know** will be acceptable
26892689
# to the `ResumableUpload` constructor. The chunk size only
26902690
# matters when **sending** bytes to an upload.
26912691
upload, _ = self._initiate_resumable_upload(
26922692
client,
2693-
dummy_stream,
2693+
fake_stream,
26942694
content_type,
26952695
size,
26962696
None,

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def system(session):
104104
# Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
105105
if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
106106
session.skip("RUN_SYSTEM_TESTS is set to false, skipping")
107-
# Sanity check: Only run tests if the environment variable is set.
107+
# Environment check: Only run tests if the environment variable is set.
108108
if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
109109
session.skip("Credentials must be set via environment variable")
110110
# mTLS tests requires pyopenssl.
@@ -113,7 +113,7 @@ def system(session):
113113

114114
system_test_exists = os.path.exists(system_test_path)
115115
system_test_folder_exists = os.path.exists(system_test_folder_path)
116-
# Sanity check: only run tests if found.
116+
# Environment check: only run tests if found.
117117
if not system_test_exists and not system_test_folder_exists:
118118
session.skip("System tests were not found")
119119

tests/unit/test__signing.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ class CET(_UTC):
9494
self.assertEqual(self._call_fut(expiration_other), cet_seconds)
9595

9696
def test_w_expiration_timedelta_seconds(self):
97-
dummy_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
98-
utc_seconds = _utc_seconds(dummy_utcnow)
97+
fake_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
98+
utc_seconds = _utc_seconds(fake_utcnow)
9999
expiration_as_delta = datetime.timedelta(seconds=10)
100100

101101
patch = mock.patch(
102-
"google.cloud.storage._signing.NOW", return_value=dummy_utcnow
102+
"google.cloud.storage._signing.NOW", return_value=fake_utcnow
103103
)
104104
with patch as utcnow:
105105
result = self._call_fut(expiration_as_delta)
@@ -108,12 +108,12 @@ def test_w_expiration_timedelta_seconds(self):
108108
utcnow.assert_called_once_with()
109109

110110
def test_w_expiration_timedelta_days(self):
111-
dummy_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
112-
utc_seconds = _utc_seconds(dummy_utcnow)
111+
fake_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
112+
utc_seconds = _utc_seconds(fake_utcnow)
113113
expiration_as_delta = datetime.timedelta(days=1)
114114

115115
patch = mock.patch(
116-
"google.cloud.storage._signing.NOW", return_value=dummy_utcnow
116+
"google.cloud.storage._signing.NOW", return_value=fake_utcnow
117117
)
118118
with patch as utcnow:
119119
result = self._call_fut(expiration_as_delta)
@@ -138,13 +138,13 @@ def test_w_expiration_none(self):
138138
self._call_fut(None)
139139

140140
def test_w_expiration_int_gt_seven_days(self):
141-
dummy_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
141+
fake_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
142142
delta = datetime.timedelta(days=10)
143-
expiration_utc = dummy_utcnow + delta
143+
expiration_utc = fake_utcnow + delta
144144
expiration_seconds = _utc_seconds(expiration_utc)
145145

146146
patch = mock.patch(
147-
"google.cloud.storage._signing.NOW", return_value=dummy_utcnow
147+
"google.cloud.storage._signing.NOW", return_value=fake_utcnow
148148
)
149149

150150
with patch as utcnow:
@@ -153,11 +153,11 @@ def test_w_expiration_int_gt_seven_days(self):
153153
utcnow.assert_called_once_with()
154154

155155
def test_w_expiration_int(self):
156-
dummy_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
156+
fake_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
157157
expiration_seconds = 10
158158

159159
patch = mock.patch(
160-
"google.cloud.storage._signing.NOW", return_value=dummy_utcnow
160+
"google.cloud.storage._signing.NOW", return_value=fake_utcnow
161161
)
162162

163163
with patch as utcnow:
@@ -167,12 +167,12 @@ def test_w_expiration_int(self):
167167
utcnow.assert_called_once_with()
168168

169169
def test_w_expiration_naive_datetime(self):
170-
dummy_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
170+
fake_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
171171
delta = datetime.timedelta(seconds=10)
172-
expiration_no_tz = dummy_utcnow + delta
172+
expiration_no_tz = fake_utcnow + delta
173173

174174
patch = mock.patch(
175-
"google.cloud.storage._signing.NOW", return_value=dummy_utcnow
175+
"google.cloud.storage._signing.NOW", return_value=fake_utcnow
176176
)
177177
with patch as utcnow:
178178
result = self._call_fut(expiration_no_tz)
@@ -183,12 +183,12 @@ def test_w_expiration_naive_datetime(self):
183183
def test_w_expiration_utc_datetime(self):
184184
from google.cloud._helpers import UTC
185185

186-
dummy_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0, UTC)
186+
fake_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0, UTC)
187187
delta = datetime.timedelta(seconds=10)
188-
expiration_utc = dummy_utcnow + delta
188+
expiration_utc = fake_utcnow + delta
189189

190190
patch = mock.patch(
191-
"google.cloud.storage._signing.NOW", return_value=dummy_utcnow
191+
"google.cloud.storage._signing.NOW", return_value=fake_utcnow
192192
)
193193
with patch as utcnow:
194194
result = self._call_fut(expiration_utc)
@@ -205,13 +205,13 @@ class CET(_UTC):
205205
_utcoffset = datetime.timedelta(hours=1)
206206

207207
zone = CET()
208-
dummy_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0, UTC)
209-
dummy_cetnow = dummy_utcnow.astimezone(zone)
208+
fake_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0, UTC)
209+
fake_cetnow = fake_utcnow.astimezone(zone)
210210
delta = datetime.timedelta(seconds=10)
211-
expiration_other = dummy_cetnow + delta
211+
expiration_other = fake_cetnow + delta
212212

213213
patch = mock.patch(
214-
"google.cloud.storage._signing.NOW", return_value=dummy_utcnow
214+
"google.cloud.storage._signing.NOW", return_value=fake_utcnow
215215
)
216216
with patch as utcnow:
217217
result = self._call_fut(expiration_other)
@@ -220,11 +220,11 @@ class CET(_UTC):
220220
utcnow.assert_called_once_with()
221221

222222
def test_w_expiration_timedelta(self):
223-
dummy_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
223+
fake_utcnow = datetime.datetime(2004, 8, 19, 0, 0, 0, 0)
224224
expiration_as_delta = datetime.timedelta(seconds=10)
225225

226226
patch = mock.patch(
227-
"google.cloud.storage._signing.NOW", return_value=dummy_utcnow
227+
"google.cloud.storage._signing.NOW", return_value=fake_utcnow
228228
)
229229
with patch as utcnow:
230230
result = self._call_fut(expiration_as_delta)
@@ -246,7 +246,7 @@ def test_it(self):
246246
credentials = _make_credentials(signer_email=account_name)
247247
credentials.sign_bytes.return_value = sig_bytes
248248
expiration = 100
249-
string_to_sign = "dummy_signature"
249+
string_to_sign = "fake_signature"
250250
result = self._call_fut(credentials, expiration, string_to_sign)
251251

252252
expected = {
@@ -770,20 +770,20 @@ def test_get_v4_now_dtstamps(self):
770770
self.assertEqual(datestamp, "20200312")
771771

772772

773-
_DUMMY_SERVICE_ACCOUNT = None
773+
_FAKE_SERVICE_ACCOUNT = None
774774

775775

776-
def dummy_service_account():
777-
global _DUMMY_SERVICE_ACCOUNT
776+
def fake_service_account():
777+
global _FAKE_SERVICE_ACCOUNT
778778

779779
from google.oauth2.service_account import Credentials
780780

781-
if _DUMMY_SERVICE_ACCOUNT is None:
782-
_DUMMY_SERVICE_ACCOUNT = Credentials.from_service_account_info(
781+
if _FAKE_SERVICE_ACCOUNT is None:
782+
_FAKE_SERVICE_ACCOUNT = Credentials.from_service_account_info(
783783
_SERVICE_ACCOUNT_JSON
784784
)
785785

786-
return _DUMMY_SERVICE_ACCOUNT
786+
return _FAKE_SERVICE_ACCOUNT
787787

788788

789789
_API_ACCESS_ENDPOINT = "https://storage.googleapis.com"
@@ -792,7 +792,7 @@ def dummy_service_account():
792792
def _run_conformance_test(
793793
resource, test_data, api_access_endpoint=_API_ACCESS_ENDPOINT
794794
):
795-
credentials = dummy_service_account()
795+
credentials = fake_service_account()
796796
url = Test_generate_signed_url_v4._call_fut(
797797
credentials,
798798
resource,

tests/unit/test_bucket.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2992,11 +2992,11 @@ def test_page_non_empty_response(self):
29922992
name = "name"
29932993
bucket = self._make_one(client=client, name=name)
29942994

2995-
def dummy_response():
2995+
def fake_response():
29962996
return response
29972997

29982998
iterator = bucket.list_blobs()
2999-
iterator._get_next_page_response = dummy_response
2999+
iterator._get_next_page_response = fake_response
30003000

30013001
page = six.next(iterator.pages)
30023002
self.assertEqual(page.prefixes, ("foo",))
@@ -3023,11 +3023,11 @@ def test_cumulative_prefixes(self):
30233023
bucket = self._make_one(client=client, name=name)
30243024
responses = [response1, response2]
30253025

3026-
def dummy_response():
3026+
def fake_response():
30273027
return responses.pop(0)
30283028

30293029
iterator = bucket.list_blobs()
3030-
iterator._get_next_page_response = dummy_response
3030+
iterator._get_next_page_response = fake_response
30313031

30323032
# Parse first response.
30333033
pages_iter = iterator.pages

tests/unit/test_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"postPolicyV4Tests"
3737
]
3838
_POST_POLICY_TESTS = [test for test in _CONFORMANCE_TESTS if "policyInput" in test]
39-
_DUMMY_CREDENTIALS = Credentials.from_service_account_info(_SERVICE_ACCOUNT_JSON)
39+
_FAKE_CREDENTIALS = Credentials.from_service_account_info(_SERVICE_ACCOUNT_JSON)
4040

4141

4242
def _make_credentials():
@@ -1462,11 +1462,11 @@ def test_list_buckets_page_non_empty_response(self):
14621462
blob_name = "bucket-name"
14631463
response = {"items": [{"name": blob_name}]}
14641464

1465-
def dummy_response():
1465+
def fake_response():
14661466
return response
14671467

14681468
iterator = client.list_buckets()
1469-
iterator._get_next_page_response = dummy_response
1469+
iterator._get_next_page_response = fake_response
14701470

14711471
page = six.next(iterator.pages)
14721472
self.assertEqual(page.num_items, 1)
@@ -2049,7 +2049,7 @@ def test_conformance_post_policy(test_data):
20492049
in_data = test_data["policyInput"]
20502050
timestamp = datetime.datetime.strptime(in_data["timestamp"], "%Y-%m-%dT%H:%M:%SZ")
20512051

2052-
client = Client(credentials=_DUMMY_CREDENTIALS, project="PROJECT")
2052+
client = Client(credentials=_FAKE_CREDENTIALS, project="PROJECT")
20532053

20542054
# mocking time functions
20552055
with mock.patch("google.cloud.storage._signing.NOW", return_value=timestamp):
@@ -2064,7 +2064,7 @@ def test_conformance_post_policy(test_data):
20642064
blob_name=in_data["object"],
20652065
conditions=_prepare_conditions(in_data),
20662066
fields=in_data.get("fields"),
2067-
credentials=_DUMMY_CREDENTIALS,
2067+
credentials=_FAKE_CREDENTIALS,
20682068
expiration=in_data["expiration"],
20692069
virtual_hosted_style=in_data.get("urlStyle")
20702070
== "VIRTUAL_HOSTED_STYLE",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"type": "service_account",
3-
"project_id": "dummy-project-id",
3+
"project_id": "test-project-id",
44
"private_key_id": "ffffffffffffffffffffffffffffffffffffffff",
55
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCsPzMirIottfQ2\nryjQmPWocSEeGo7f7Q4/tMQXHlXFzo93AGgU2t+clEj9L5loNhL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noaWxBPgatOVWs7RgtyGYsk+XubHkpC6f3X0+15mGhFwJ+CSE6tN+l2iF9zp52vqP\nQwkjzm7+pdhZbmaIpcq9m1K+9lqPWJRz/3XXuqi+5xWIZ7NaxGvRjqaNAoGAdK2b\nutZ2y48XoI3uPFsuP+A8kJX+CtWZrlE1NtmS7tnicdd19AtfmTuUL6fz0FwfW4Su\nlQZfPT/5B339CaEiq/Xd1kDor+J7rvUHM2+5p+1A54gMRGCLRv92FQ4EON0RC1o9\nm2I4SHysdO3XmjmdXmfp4BsgAKJIJzutvtbqlakCgYB+Cb10z37NJJ+WgjDt+yT2\nyUNH17EAYgWXryfRgTyi2POHuJitd64Xzuy6oBVs3wVveYFM6PIKXlj8/DahYX5I\nR2WIzoCNLL3bEZ+nC6Jofpb4kspoAeRporj29SgesK6QBYWHWX2H645RkRGYGpDo\n51gjy9m/hSNqBbH2zmh04A==\n-----END PRIVATE KEY-----\n",
6-
"client_email": "test-iam-credentials@dummy-project-id.iam.gserviceaccount.com",
6+
"client_email": "test-iam-credentials@test-project-id.iam.gserviceaccount.com",
77
"client_id": "000000000000000000000",
88
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
99
"token_uri": "https://oauth2.googleapis.com/token",
1010
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11-
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test-iam-credentials%40dummy-project-id.iam.gserviceaccount.com"
11+
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test-iam-credentials%40test-project-id.iam.gserviceaccount.com"
1212
}

0 commit comments

Comments
 (0)