|
6 | 6 |
|
7 | 7 | instance = MLFlow("test", 2.0, Dict(), nothing, nothing) |
8 | 8 |
|
9 | | - @test instance.apiroot == "test" |
| 9 | + @test instance.apiroot == "test/api" |
10 | 10 | @test instance.apiversion == 2.0 |
11 | 11 | @test instance.headers == Dict() |
12 | 12 | @test isnothing(instance.username) |
|
20 | 20 |
|
21 | 21 | instance = MLFlow("test") |
22 | 22 |
|
23 | | - @test instance.apiroot == "test" |
| 23 | + @test instance.apiroot == "test/api" |
24 | 24 | @test instance.apiversion == 2.0 |
25 | 25 | @test instance.headers == Dict() |
26 | 26 | @test isnothing(instance.username) |
|
71 | 71 | @test_throws ErrorException MLFlow(; username="test", password="test", |
72 | 72 | headers=Dict("Authorization" => "Basic $encoded_credentials")) |
73 | 73 | end |
| 74 | + |
| 75 | + @testset "appending /api to tracking uri" begin |
| 76 | + delete!(ENV, "MLFLOW_TRACKING_URI") |
| 77 | + |
| 78 | + instance_no_slash = MLFlow("https://dagshub.com/user/repo.mlflow") |
| 79 | + @test instance_no_slash.apiroot == "https://dagshub.com/user/repo.mlflow/api" |
| 80 | + |
| 81 | + instance_with_slash = MLFlow("https://dagshub.com/user/repo.mlflow/") |
| 82 | + @test instance_with_slash.apiroot == "https://dagshub.com/user/repo.mlflow/api" |
| 83 | + |
| 84 | + instance_already_api = MLFlow("https://dagshub.com/user/repo.mlflow/api") |
| 85 | + @test instance_already_api.apiroot == "https://dagshub.com/user/repo.mlflow/api" |
| 86 | + |
| 87 | + instance_already_api_slash = MLFlow("https://dagshub.com/user/repo.mlflow/api/") |
| 88 | + @test instance_already_api_slash.apiroot == "https://dagshub.com/user/repo.mlflow/api/" |
| 89 | + |
| 90 | + if !isnothing(mlflow_tracking_uri) |
| 91 | + ENV["MLFLOW_TRACKING_URI"] = mlflow_tracking_uri |
| 92 | + end |
| 93 | + end |
74 | 94 | end |
0 commit comments