|
237 | 237 | @test_throws TypeError JuliaHub.update_dataset(
|
238 | 238 | "example-dataset"; description=42
|
239 | 239 | )
|
| 240 | + # Different options for `license` keyword |
| 241 | + @test JuliaHub.update_dataset("example-dataset"; license="MIT") isa JuliaHub.Dataset |
| 242 | + @test JuliaHub.update_dataset("example-dataset"; license=(:spdx, "MIT")) isa |
| 243 | + JuliaHub.Dataset |
| 244 | + @test JuliaHub.update_dataset("example-dataset"; license=(:fulltext, "...")) isa |
| 245 | + JuliaHub.Dataset |
| 246 | + # This should log a deprecation warning |
| 247 | + @test @test_logs ( |
| 248 | + :warn, |
| 249 | + "Passing license=(:text, ...) is deprecated, use license=(:fulltext, ...) instead.", |
| 250 | + ) JuliaHub.update_dataset( |
| 251 | + "example-dataset"; license=(:text, "...") |
| 252 | + ) isa JuliaHub.Dataset |
| 253 | + @test_throws TypeError JuliaHub.update_dataset("example-dataset"; license=1234) |
| 254 | + @test_throws ArgumentError JuliaHub.update_dataset("example-dataset"; license=(:foo, "")) |
| 255 | + @test_throws TypeError JuliaHub.update_dataset( |
| 256 | + "example-dataset"; license=(:fulltext, 1234) |
| 257 | + ) |
240 | 258 | end
|
241 | 259 | end
|
242 | 260 |
|
|
293 | 311 |
|
294 | 312 | # @test JuliaHub.upload_dataset(
|
295 | 313 | # "existing-dataset", @__FILE__; update=true) isa JuliaHub.Dataset
|
| 314 | + |
| 315 | + # Different options for `license` keyword |
| 316 | + @test JuliaHub.upload_dataset( |
| 317 | + "example-dataset-license", @__FILE__; create=true, license="MIT" |
| 318 | + ) isa JuliaHub.Dataset |
| 319 | + @test JuliaHub.upload_dataset( |
| 320 | + "example-dataset-license", @__FILE__; replace=true, license=(:spdx, "MIT") |
| 321 | + ) isa JuliaHub.Dataset |
| 322 | + @test JuliaHub.upload_dataset( |
| 323 | + "example-dataset-license", @__FILE__; replace=true, license=(:fulltext, "...") |
| 324 | + ) isa JuliaHub.Dataset |
| 325 | + # This should log a deprecation warning |
| 326 | + @test @test_logs ( |
| 327 | + :warn, |
| 328 | + "Passing license=(:text, ...) is deprecated, use license=(:fulltext, ...) instead.", |
| 329 | + ) JuliaHub.upload_dataset( |
| 330 | + "example-dataset-license", @__FILE__; replace=true, license=(:text, "...") |
| 331 | + ) isa JuliaHub.Dataset |
| 332 | + @test_throws TypeError JuliaHub.upload_dataset( |
| 333 | + "example-dataset-license", @__FILE__; replace=true, license=1234 |
| 334 | + ) |
| 335 | + @test_throws ArgumentError JuliaHub.upload_dataset( |
| 336 | + "example-dataset-license", @__FILE__; replace=true, license=(:foo, "") |
| 337 | + ) |
| 338 | + @test_throws TypeError JuliaHub.upload_dataset( |
| 339 | + "example-dataset-license", @__FILE__; replace=true, license=(:fulltext, 1234) |
| 340 | + ) |
296 | 341 | end
|
297 | 342 | empty!(MOCK_JULIAHUB_STATE)
|
298 | 343 | end
|
0 commit comments