mirror of
https://github.com/canonical/ubuntu-desktop-provision.git
synced 2025-07-23 00:45:04 +00:00
fix: backport 'reset storage before setting a guided target' to 24.04 (#1127)
Backport of #986
This commit is contained in:
@ -87,6 +87,7 @@ class StorageService {
|
||||
|
||||
/// Sets the selected target for guided partitioning.
|
||||
Future<void> setGuidedStorage() async {
|
||||
await _client.resetStorageV2();
|
||||
await _client.setGuidedStorageV2(
|
||||
GuidedChoiceV2(
|
||||
target: guidedTarget!,
|
||||
|
@ -34,6 +34,8 @@ void main() {
|
||||
state: ApplicationState.RUNNING,
|
||||
),
|
||||
);
|
||||
when(client.resetStorageV2())
|
||||
.thenAnswer((_) async => fakeStorageResponse());
|
||||
});
|
||||
|
||||
test('get guided storage', () async {
|
||||
@ -62,6 +64,7 @@ void main() {
|
||||
final service = StorageService(client);
|
||||
service.guidedTarget = target;
|
||||
await service.setGuidedStorage();
|
||||
verify(client.resetStorageV2()).called(1);
|
||||
verify(client.setGuidedStorageV2(choice)).called(1);
|
||||
verify(client.setStorageV2()).called(1);
|
||||
});
|
||||
@ -85,6 +88,7 @@ void main() {
|
||||
|
||||
service.guidedTarget = target;
|
||||
await service.setGuidedStorage();
|
||||
verify(client.resetStorageV2()).called(1);
|
||||
verify(client.setGuidedStorageV2(choice)).called(1);
|
||||
verify(client.setStorageV2()).called(1);
|
||||
});
|
||||
|
Reference in New Issue
Block a user