Skip to content

Commit 1fbb3ce

Browse files
🧪 test: update tests to use Backup instead of BackupData
- Adjusted tests in `tests/test_app.py`, `tests/test_app_data.py`, `tests/test_capture_listeners.py`, and `tests/test_request_listeners.py` to align with the new `Backup` class.
1 parent d8400b8 commit 1fbb3ce

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

tests/test_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async def test_app_logs(self, app: Application):
2121
assert isinstance(await app.logs(), squarecloud.LogsData)
2222

2323
async def test_app_backup(self, app: Application):
24-
assert isinstance(await app.backup(), squarecloud.BackupData)
24+
assert isinstance(await app.backup(), squarecloud.Backup)
2525

2626
async def test_app_github_integration(self, app: Application):
2727
assert isinstance(await app.github_integration(GITHUB_ACCESS_TOKEN), str)

tests/test_app_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44

55
from squarecloud.app import Application
6-
from squarecloud.data import BackupData, LogsData, StatusData
6+
from squarecloud.data import Backup, LogsData, StatusData
77

88

99
@pytest.mark.asyncio(scope='session')
@@ -34,7 +34,7 @@ async def test_backup(self, app: Application):
3434
assert cache.backup is None
3535

3636
cache.update(backup)
37-
assert isinstance(cache.backup, BackupData)
37+
assert isinstance(cache.backup, Backup)
3838

3939
cache.clear()
4040
assert cache.backup is None

tests/test_capture_listeners.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from squarecloud import Endpoint, errors
55
from squarecloud.app import Application
6-
from squarecloud.data import AppData, BackupData, LogsData, StatusData
6+
from squarecloud.data import AppData, Backup, LogsData, StatusData
77
from squarecloud.listeners import Listener
88

99

@@ -35,7 +35,7 @@ async def test_capture_backup(self, app: Application):
3535
@app.capture(Endpoint.backup(), force_raise=True)
3636
async def capture_backup(before, after):
3737
assert before is None
38-
assert isinstance(after, BackupData)
38+
assert isinstance(after, Backup)
3939

4040
await app.backup()
4141

tests/test_request_listeners.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from squarecloud.app import Application
88
from squarecloud.data import (
99
AppData,
10-
BackupData,
10+
Backup,
1111
DeployData,
1212
DomainAnalytics,
1313
FileInfo,
@@ -67,16 +67,16 @@ async def test_listener(response: Response):
6767
@_clear_listener_on_rerun(Endpoint.backup())
6868
async def test_request_backup(self, client: Client, app: Application):
6969
endpoint: Endpoint = Endpoint.backup()
70-
expected_result: BackupData | None
71-
expected_response: BackupData | None = None
70+
expected_result: Backup | None
71+
expected_response: Backup | None = None
7272

7373
@client.on_request(endpoint)
7474
async def test_listener(response: Response):
7575
nonlocal expected_response
7676
expected_response = response
7777

7878
expected_result = await client.backup(app.id)
79-
assert isinstance(expected_result, BackupData)
79+
assert isinstance(expected_result, Backup)
8080
assert isinstance(expected_response, Response)
8181

8282
@_clear_listener_on_rerun(Endpoint.start())

0 commit comments

Comments
 (0)