(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestDiskUsageWithOptions(t *testing.T) { |
| 52 | const expectedURL = "/system/df" |
| 53 | |
| 54 | tests := []struct { |
| 55 | options DiskUsageOptions |
| 56 | expectedQuery string |
| 57 | }{ |
| 58 | { |
| 59 | options: DiskUsageOptions{ |
| 60 | Containers: true, |
| 61 | }, |
| 62 | expectedQuery: "type=container", |
| 63 | }, |
| 64 | { |
| 65 | options: DiskUsageOptions{ |
| 66 | Images: true, |
| 67 | }, |
| 68 | expectedQuery: "type=image", |
| 69 | }, |
| 70 | { |
| 71 | options: DiskUsageOptions{ |
| 72 | Volumes: true, |
| 73 | }, |
| 74 | expectedQuery: "type=volume", |
| 75 | }, |
| 76 | { |
| 77 | options: DiskUsageOptions{ |
| 78 | BuildCache: true, |
| 79 | }, |
| 80 | expectedQuery: "type=build-cache", |
| 81 | }, |
| 82 | { |
| 83 | options: DiskUsageOptions{ |
| 84 | Containers: true, |
| 85 | Images: true, |
| 86 | }, |
| 87 | expectedQuery: "type=container&type=image", |
| 88 | }, |
| 89 | { |
| 90 | options: DiskUsageOptions{ |
| 91 | Containers: true, |
| 92 | Images: true, |
| 93 | Volumes: true, |
| 94 | BuildCache: true, |
| 95 | }, |
| 96 | expectedQuery: "type=container&type=image&type=volume&type=build-cache", |
| 97 | }, |
| 98 | { |
| 99 | options: DiskUsageOptions{ |
| 100 | Containers: true, |
| 101 | Verbose: true, |
| 102 | }, |
| 103 | expectedQuery: "type=container&verbose=1", |
| 104 | }, |
| 105 | { |
| 106 | options: DiskUsageOptions{ |
| 107 | Containers: true, |
| 108 | Images: true, |
nothing calls this directly
no test coverage detected
searching dependent graphs…