diff --git a/storage/noxfile.py b/storage/noxfile.py index a391c6732b70..0d318c75dfde 100644 --- a/storage/noxfile.py +++ b/storage/noxfile.py @@ -118,7 +118,7 @@ def system(session): session.install("-e", ".") # Run py.test against the system tests. - session.run("py.test", "--quiet", "tests/system.py", *session.posargs) + session.run("py.test", "--quiet", "tests/system", *session.posargs) @nox.session(python="3.6") diff --git a/storage/tests/system.py b/storage/tests/system/test_system.py similarity index 99% rename from storage/tests/system.py rename to storage/tests/system/test_system.py index 2bfaa5b8f492..58ecdfd8e1b7 100644 --- a/storage/tests/system.py +++ b/storage/tests/system/test_system.py @@ -40,6 +40,8 @@ USER_PROJECT = os.environ.get("GOOGLE_CLOUD_TESTS_USER_PROJECT") +DIRNAME = os.path.realpath(os.path.dirname(__file__)) +DATA_DIRNAME = os.path.abspath(os.path.join(DIRNAME, "..", "data")) def _bad_copy(bad_request): @@ -381,11 +383,10 @@ def test_bucket_get_blob_with_user_project(self): class TestStorageFiles(unittest.TestCase): - DIRNAME = os.path.realpath(os.path.dirname(__file__)) FILES = { - "logo": {"path": DIRNAME + "/data/CloudPlatform_128px_Retina.png"}, - "big": {"path": DIRNAME + "/data/five-point-one-mb-file.zip"}, - "simple": {"path": DIRNAME + "/data/simple.txt"}, + "logo": {"path": DATA_DIRNAME + "/CloudPlatform_128px_Retina.png"}, + "big": {"path": DATA_DIRNAME + "/five-point-one-mb-file.zip"}, + "simple": {"path": DATA_DIRNAME + "/simple.txt"}, } @classmethod