Skip to content

Commit 8ec5b15

Browse files
Andrey Cheptsovclaude
andcommitted
Fix tests: add data_transfer_bytes to expected API responses
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 26fcbe3 commit 8ec5b15

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/dstack/_internal/server/migrations/versions/2026/03_25_1200_a1b2c3d4e5f6_add_data_transfer_bytes_to_instances.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Add data_transfer_bytes to instances
22
33
Revision ID: a1b2c3d4e5f6
4-
Revises: 8b6d5d8c1b9a
4+
Revises: c1c2ecaee45c
55
Create Date: 2026-03-25 12:00:00.000000+00:00
66
77
"""
@@ -11,7 +11,7 @@
1111

1212
# revision identifiers, used by Alembic.
1313
revision = "a1b2c3d4e5f6"
14-
down_revision = "8b6d5d8c1b9a"
14+
down_revision = "c1c2ecaee45c"
1515
branch_labels = None
1616
depends_on = None
1717

src/dstack/_internal/server/services/instances.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def instance_model_to_instance(instance_model: InstanceModel) -> Instance:
241241
finished_at=instance_model.finished_at,
242242
total_blocks=instance_model.total_blocks,
243243
busy_blocks=instance_model.busy_blocks,
244-
data_transfer_bytes=instance_model.data_transfer_bytes,
244+
data_transfer_bytes=instance_model.data_transfer_bytes or 0,
245245
)
246246

247247
offer = get_instance_offer(instance_model)

src/tests/_internal/server/routers/test_fleets.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,7 @@ async def test_creates_fleet(self, test_db, session: AsyncSession, client: Async
10251025
"price": None,
10261026
"total_blocks": 1,
10271027
"busy_blocks": 0,
1028+
"data_transfer_bytes": 0,
10281029
}
10291030
],
10301031
}
@@ -1167,6 +1168,7 @@ async def test_creates_ssh_fleet(self, test_db, session: AsyncSession, client: A
11671168
"price": 0.0,
11681169
"total_blocks": 1,
11691170
"busy_blocks": 0,
1171+
"data_transfer_bytes": 0,
11701172
}
11711173
],
11721174
}
@@ -1347,6 +1349,7 @@ async def test_updates_ssh_fleet(self, test_db, session: AsyncSession, client: A
13471349
"price": 0.0,
13481350
"total_blocks": 1,
13491351
"busy_blocks": 0,
1352+
"data_transfer_bytes": 0,
13501353
},
13511354
{
13521355
"id": SomeUUID4Str(),
@@ -1382,6 +1385,7 @@ async def test_updates_ssh_fleet(self, test_db, session: AsyncSession, client: A
13821385
"price": 0.0,
13831386
"total_blocks": 1,
13841387
"busy_blocks": 0,
1388+
"data_transfer_bytes": 0,
13851389
},
13861390
],
13871391
}

0 commit comments

Comments
 (0)