{"id":18841183,"url":"https://github.com/poogles/pytest-gcs","last_synced_at":"2025-04-11T15:03:44.607Z","repository":{"id":223132591,"uuid":"759090753","full_name":"Poogles/pytest-gcs","owner":"Poogles","description":"Pytest fixtures for creating and interacting with a local instance of GCS.","archived":false,"fork":false,"pushed_at":"2025-01-24T15:46:05.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T11:04:18.423Z","etag":null,"topics":["gcs","google-cloud","google-cloud-sto","pytest","pytest-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Poogles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-17T18:44:41.000Z","updated_at":"2025-01-24T15:48:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"02d81276-a3e7-4ab3-bf97-76090427691b","html_url":"https://github.com/Poogles/pytest-gcs","commit_stats":null,"previous_names":["poogles/pytest-gcs"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpytest-gcs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpytest-gcs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpytest-gcs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Poogles%2Fpytest-gcs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Poogles","download_url":"https://codeload.github.com/Poogles/pytest-gcs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248428957,"owners_count":21101779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gcs","google-cloud","google-cloud-sto","pytest","pytest-plugin"],"created_at":"2024-11-08T02:50:20.494Z","updated_at":"2025-04-11T15:03:44.568Z","avatar_url":"https://github.com/Poogles.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Pytest GCS\n\nThis is a pytest plugin in similar vein to [pytest-postgres](https://github.com/ClearcodeHQ/pytest-postgresql) and [pytest-kafka](https://pypi.org/project/pytest-kafka/).\n\nThis would have been much more painful without [Mirakuru](https://github.com/ClearcodeHQ/mirakuru)\nand [fake-gcs-server](https://github.com/fsouza/fake-gcs-server); this is a simple wrapper around\nthose tools.\n\n\n### Installation\n\nThis tool requires you to have a copy of the `fake-gcs-server` binary somewhere on your path.\nDepending upon your architecture you'll need a different version of the tool.\n\n```sh\nwget https://github.com/fsouza/fake-gcs-server/releases/download/v1.47.8/fake-gcs-server_1.47.8_Linux_amd64.tar.gz\ntar -xvf fake-gcs-server_1.47.8_Linux_amd64.tar.gz\nmv fake-gcs-server /usr/local/bin\n```\n\nTo install this library:\n\n```sh\npip install pytest-gcs\n```\n\n\n### Demo\n\n```python\n# conftest.py\nfrom pytest_gcs.factories import client as gcs_client\nfrom pytest_gcs.factories import proc as gcs_process\n\n# Create a process and a local client that targets that process.\ngcs_proc = gcs_process.gcs_proc()\ngcslocal = gcs_client.gcslocal(\"gcs_proc\")\n\n# tests/test_gcs.py\nfrom google.cloud import storage\nfrom pytest_gcs.executor.process import GCSExecutor\n\n\ndef test_can_create_gcs_bucket(gcs_proc: GCSExecutor, gcslocal: storage.Client) -\u003e None:\n    \"\"\"MVP to ensure everything works.\"\"\"\n    bucket = \"test_base\"\n    gcslocal.create_bucket(bucket)\n    buckets = [x.name for x in gcslocal.list_buckets()]\n\n    assert bucket in buckets\n```\n\n\n### Contributing\n\nPRs are accepted.\n\n```sh\n# Install the dependencies with:\npip install .[test]\n# Install pre-commit hooks.\npre-commit install\n# Validate everything passes.\npre-commit run --all\n# Run the tests.\npytest tests/\n```\n\n\n### TODOs\n\n* Implement the events outputs, `-event.bucket`, `-event.list`, etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoogles%2Fpytest-gcs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoogles%2Fpytest-gcs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoogles%2Fpytest-gcs/lists"}