(t *testing.T)
| 138 | } |
| 139 | |
| 140 | func TestIsRemoteConfig(t *testing.T) { |
| 141 | ctrl := gomock.NewController(t) |
| 142 | defer ctrl.Finish() |
| 143 | cli := mocks.NewMockCli(ctrl) |
| 144 | |
| 145 | tests := []struct { |
| 146 | name string |
| 147 | configPaths []string |
| 148 | want bool |
| 149 | }{ |
| 150 | { |
| 151 | name: "empty config paths", |
| 152 | configPaths: []string{}, |
| 153 | want: false, |
| 154 | }, |
| 155 | { |
| 156 | name: "local file", |
| 157 | configPaths: []string{"docker-compose.yaml"}, |
| 158 | want: false, |
| 159 | }, |
| 160 | { |
| 161 | name: "OCI reference", |
| 162 | configPaths: []string{"oci://registry.example.com/stack:latest"}, |
| 163 | want: true, |
| 164 | }, |
| 165 | { |
| 166 | name: "GIT reference", |
| 167 | configPaths: []string{"git://github.com/user/repo.git"}, |
| 168 | want: true, |
| 169 | }, |
| 170 | } |
| 171 | |
| 172 | for _, tt := range tests { |
| 173 | t.Run(tt.name, func(t *testing.T) { |
| 174 | opts := buildOptions{ |
| 175 | ProjectOptions: &ProjectOptions{ |
| 176 | ConfigPaths: tt.configPaths, |
| 177 | }, |
| 178 | } |
| 179 | got := isRemoteConfig(cli, opts) |
| 180 | assert.Equal(t, tt.want, got) |
| 181 | }) |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | func TestDisplayLocationRemoteStack(t *testing.T) { |
| 186 | ctrl := gomock.NewController(t) |
nothing calls this directly
no test coverage detected