diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05a6887..a205cd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,12 +11,12 @@ jobs: python: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.8 cache: pipenv - - run: pip install pipenv + - run: pip install pipenv==2022.12.19 - run: pipenv install --dev --deploy - run: pipenv run black --check --diff --color --exclude '.*_pb2.py' . - run: pipenv run pyright foxglove_data_platform diff --git a/foxglove_data_platform/client.py b/foxglove_data_platform/client.py index c020a6d..dd6caa6 100644 --- a/foxglove_data_platform/client.py +++ b/foxglove_data_platform/client.py @@ -577,6 +577,12 @@ def delete_import(self, *, device_id: Optional[str] = None, import_id: str): ) json_or_raise(response) + def delete_recording(self, *, recording_id: str): + response = requests.delete( + self.__url__(f"/v1/recordings/{recording_id}"), headers=self.__headers + ) + json_or_raise(response) + def get_imports( self, *, diff --git a/tests/test_recordings.py b/tests/test_recordings.py index dee3b1d..600d482 100644 --- a/tests/test_recordings.py +++ b/tests/test_recordings.py @@ -10,6 +10,21 @@ fake = Faker() +@responses.activate +def test_delete_recording(): + recording_id = fake.uuid4() + responses.add( + responses.DELETE, + api_url(f"/v1/recordings/{recording_id}"), + json={"success": True, "id": recording_id}, + ) + client = Client("test") + try: + client.delete_recording(recording_id=recording_id) + except: + assert False + + @responses.activate def test_get_recordings(): device_id = fake.uuid4()