Skip to content

Commit

Permalink
Make job id a proper UUID in response model (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdegat01 authored Jan 29, 2025
1 parent 2a0dc39 commit 7e92f6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion aiohasupervisor/models/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from datetime import datetime
from enum import StrEnum
from pathlib import PurePath
from uuid import UUID

from .base import Options, Request, ResponseData

Expand Down Expand Up @@ -167,7 +168,7 @@ class PartialBackupOptions(FullBackupOptions, PartialBackupRestoreOptions):
class BackupJob(ResponseData):
"""BackupJob model."""

job_id: str
job_id: UUID


@dataclass(frozen=True, slots=True)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ async def test_backups_full_backup(
callback=backup_callback,
)
result = await supervisor_client.backups.full_backup(options)
assert result.job_id == "dc9dbc16f6ad4de592ffa72c807ca2bf"
assert result.job_id.hex == "dc9dbc16f6ad4de592ffa72c807ca2bf"
assert result.slug == slug


Expand Down Expand Up @@ -280,7 +280,7 @@ async def test_backups_partial_backup(
callback=backup_callback,
)
result = await supervisor_client.backups.partial_backup(options)
assert result.job_id == "dc9dbc16f6ad4de592ffa72c807ca2bf"
assert result.job_id.hex == "dc9dbc16f6ad4de592ffa72c807ca2bf"
assert result.slug == slug


Expand Down Expand Up @@ -401,7 +401,7 @@ async def test_full_restore(
body=load_fixture("backup_restore.json"),
)
result = await supervisor_client.backups.full_restore("abc123", options)
assert result.job_id == "dc9dbc16f6ad4de592ffa72c807ca2bf"
assert result.job_id.hex == "dc9dbc16f6ad4de592ffa72c807ca2bf"


@pytest.mark.parametrize(
Expand All @@ -426,7 +426,7 @@ async def test_partial_restore(
body=load_fixture("backup_restore.json"),
)
result = await supervisor_client.backups.partial_restore("abc123", options)
assert result.job_id == "dc9dbc16f6ad4de592ffa72c807ca2bf"
assert result.job_id.hex == "dc9dbc16f6ad4de592ffa72c807ca2bf"


@pytest.mark.parametrize(
Expand Down

0 comments on commit 7e92f6f

Please sign in to comment.