Skip to content

Commit 7ff682d

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 6499f05 commit 7ff682d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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
@@ -963,6 +963,7 @@ async def test_creates_fleet(self, test_db, session: AsyncSession, client: Async
963963
"price": None,
964964
"total_blocks": 1,
965965
"busy_blocks": 0,
966+
"data_transfer_bytes": 0,
966967
}
967968
],
968969
}
@@ -1105,6 +1106,7 @@ async def test_creates_ssh_fleet(self, test_db, session: AsyncSession, client: A
11051106
"price": 0.0,
11061107
"total_blocks": 1,
11071108
"busy_blocks": 0,
1109+
"data_transfer_bytes": 0,
11081110
}
11091111
],
11101112
}
@@ -1285,6 +1287,7 @@ async def test_updates_ssh_fleet(self, test_db, session: AsyncSession, client: A
12851287
"price": 0.0,
12861288
"total_blocks": 1,
12871289
"busy_blocks": 0,
1290+
"data_transfer_bytes": 0,
12881291
},
12891292
{
12901293
"id": SomeUUID4Str(),
@@ -1320,6 +1323,7 @@ async def test_updates_ssh_fleet(self, test_db, session: AsyncSession, client: A
13201323
"price": 0.0,
13211324
"total_blocks": 1,
13221325
"busy_blocks": 0,
1326+
"data_transfer_bytes": 0,
13231327
},
13241328
],
13251329
}

0 commit comments

Comments
 (0)