Skip to content
Permalink
Browse files
fix: add classifer for Python 3.8 (#63)
* fix: add classifer for Python 3.8

* fix: update black version
  • Loading branch information
crwilcox committed Feb 14, 2020
1 parent 23df542 commit 1b9b6bc2601ee336a8399266852fb850e368b30a
Showing with 26 additions and 25 deletions.
  1. +6 −6 noxfile.py
  2. +1 −0 setup.py
  3. +2 −2 tests/system/test_system.py
  4. +1 −1 tests/unit/test_blob.py
  5. +16 −16 tests/unit/test_bucket.py
@@ -23,14 +23,14 @@
import nox


BLACK_VERSION = "black==19.3b0"
BLACK_VERSION = "black==19.10b0"
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

if os.path.exists("samples"):
BLACK_PATHS.append("samples")


@nox.session(python="3.7")
@nox.session(python="3.8")
def lint(session):
"""Run linters.
@@ -56,7 +56,7 @@ def blacken(session):
session.run("black", *BLACK_PATHS)


@nox.session(python="3.7")
@nox.session(python="3.8")
def lint_setup_py(session):
"""Verify that setup.py is valid (including RST check)."""
session.install("docutils", "pygments")
@@ -89,7 +89,7 @@ def unit(session):
default(session)


@nox.session(python=["2.7", "3.7"])
@nox.session(python=["2.7", "3.8"])
def system(session):
"""Run the system test suite."""
system_test_path = os.path.join("tests", "system.py")
@@ -124,7 +124,7 @@ def system(session):
session.run("py.test", "--quiet", system_test_folder_path, *session.posargs)


@nox.session(python="3.7")
@nox.session(python="3.8")
def cover(session):
"""Run the final coverage report.
@@ -137,7 +137,7 @@ def cover(session):
session.run("coverage", "erase")


@nox.session(python="3.7")
@nox.session(python="3.8")
def docs(session):
"""Build the docs for this library."""

@@ -76,6 +76,7 @@
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Operating System :: OS Independent",
"Topic :: Internet",
],
@@ -1495,7 +1495,7 @@ class TestAnonymousClient(unittest.TestCase):
def test_access_to_public_bucket(self):
anonymous = storage.Client.create_anonymous_client()
bucket = anonymous.bucket(self.PUBLIC_BUCKET)
blob, = retry_429_503(bucket.list_blobs)(max_results=1)
(blob,) = retry_429_503(bucket.list_blobs)(max_results=1)
with tempfile.TemporaryFile() as stream:
retry_429_503(blob.download_to_file)(stream)

@@ -1582,7 +1582,7 @@ def test_blob_w_explicit_kms_key_name(self):
# We don't know the current version of the key.
self.assertTrue(blob.kms_key_name.startswith(kms_key_name))

listed, = list(self.bucket.list_blobs())
(listed,) = list(self.bucket.list_blobs())
self.assertTrue(listed.kms_key_name.startswith(kms_key_name))

def test_bucket_w_default_kms_key_name(self):
@@ -2451,7 +2451,7 @@ def test_rewrite_w_generations(self):
self.assertEqual(rewritten, 33)
self.assertEqual(size, 42)

kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(
kw["path"],
@@ -648,7 +648,7 @@ def test_get_blob_miss(self):
bucket = self._make_one(name=NAME)
result = bucket.get_blob(NONESUCH, client=client, timeout=42)
self.assertIsNone(result)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, NONESUCH))
self.assertEqual(kw["timeout"], 42)
@@ -663,7 +663,7 @@ def test_get_blob_hit_w_user_project(self):
blob = bucket.get_blob(BLOB_NAME, client=client)
self.assertIs(blob.bucket, bucket)
self.assertEqual(blob.name, BLOB_NAME)
kw, = connection._requested
(kw,) = connection._requested
expected_qp = {"userProject": USER_PROJECT, "projection": "noAcl"}
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
@@ -681,7 +681,7 @@ def test_get_blob_hit_w_generation(self):
self.assertIs(blob.bucket, bucket)
self.assertEqual(blob.name, BLOB_NAME)
self.assertEqual(blob.generation, GENERATION)
kw, = connection._requested
(kw,) = connection._requested
expected_qp = {"generation": GENERATION, "projection": "noAcl"}
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
@@ -704,7 +704,7 @@ def test_get_blob_hit_with_kwargs(self):
)
self.assertIs(blob.bucket, bucket)
self.assertEqual(blob.name, BLOB_NAME)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
self.assertEqual(kw["headers"], _get_encryption_headers(KEY))
@@ -720,7 +720,7 @@ def test_list_blobs_defaults(self):
iterator = bucket.list_blobs()
blobs = list(iterator)
self.assertEqual(blobs, [])
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o" % NAME)
self.assertEqual(kw["query_params"], {"projection": "noAcl"})
@@ -762,7 +762,7 @@ def test_list_blobs_w_all_arguments_and_user_project(self):
)
blobs = list(iterator)
self.assertEqual(blobs, [])
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "GET")
self.assertEqual(kw["path"], "/b/%s/o" % NAME)
self.assertEqual(kw["query_params"], EXPECTED)
@@ -935,7 +935,7 @@ def test_delete_blob_miss(self):
client = _Client(connection)
bucket = self._make_one(client=client, name=NAME)
self.assertRaises(NotFound, bucket.delete_blob, NONESUCH)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "DELETE")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, NONESUCH))
self.assertEqual(kw["query_params"], {})
@@ -950,7 +950,7 @@ def test_delete_blob_hit_with_user_project(self):
bucket = self._make_one(client=client, name=NAME, user_project=USER_PROJECT)
result = bucket.delete_blob(BLOB_NAME, timeout=42)
self.assertIsNone(result)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "DELETE")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
self.assertEqual(kw["query_params"], {"userProject": USER_PROJECT})
@@ -965,7 +965,7 @@ def test_delete_blob_hit_with_generation(self):
bucket = self._make_one(client=client, name=NAME)
result = bucket.delete_blob(BLOB_NAME, generation=GENERATION)
self.assertIsNone(result)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "DELETE")
self.assertEqual(kw["path"], "/b/%s/o/%s" % (NAME, BLOB_NAME))
self.assertEqual(kw["query_params"], {"generation": GENERATION})
@@ -1056,7 +1056,7 @@ def test_copy_blobs_wo_name(self):
self.assertIs(new_blob.bucket, dest)
self.assertEqual(new_blob.name, BLOB_NAME)

kw, = connection._requested
(kw,) = connection._requested
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
SOURCE, BLOB_NAME, DEST, BLOB_NAME
)
@@ -1082,7 +1082,7 @@ def test_copy_blobs_source_generation(self):
self.assertIs(new_blob.bucket, dest)
self.assertEqual(new_blob.name, BLOB_NAME)

kw, = connection._requested
(kw,) = connection._requested
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
SOURCE, BLOB_NAME, DEST, BLOB_NAME
)
@@ -1149,7 +1149,7 @@ def test_copy_blobs_w_name_and_user_project(self):
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
SOURCE, BLOB_NAME, DEST, NEW_NAME
)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], COPY_PATH)
self.assertEqual(kw["query_params"], {"userProject": USER_PROJECT})
@@ -1175,7 +1175,7 @@ def test_rename_blob(self):
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
BUCKET_NAME, BLOB_NAME, BUCKET_NAME, NEW_BLOB_NAME
)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], COPY_PATH)
self.assertEqual(kw["query_params"], {})
@@ -1200,7 +1200,7 @@ def test_rename_blob_to_itself(self):
COPY_PATH = "/b/{}/o/{}/copyTo/b/{}/o/{}".format(
BUCKET_NAME, BLOB_NAME, BUCKET_NAME, BLOB_NAME
)
kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], COPY_PATH)
self.assertEqual(kw["query_params"], {})
@@ -2676,7 +2676,7 @@ def test_lock_retention_policy_ok(self):

bucket.lock_retention_policy(timeout=42)

kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], "/b/{}/lockRetentionPolicy".format(name))
self.assertEqual(kw["query_params"], {"ifMetagenerationMatch": 1234})
@@ -2707,7 +2707,7 @@ def test_lock_retention_policy_w_user_project(self):

bucket.lock_retention_policy()

kw, = connection._requested
(kw,) = connection._requested
self.assertEqual(kw["method"], "POST")
self.assertEqual(kw["path"], "/b/{}/lockRetentionPolicy".format(name))
self.assertEqual(

0 comments on commit 1b9b6bc

Please sign in to comment.