xref: /aosp_15_r20/prebuilts/sdk/update_prebuilts/test_maven.py (revision 344a7f5ef16c479e7a7f54ee6567a9d112f9e72b)
1#!/usr/bin/python3
2import maven
3
4
5def test_maven_path_for_artifact():
6    maven_path = maven.maven_path_for_artifact(
7        "gmaven", "androidx/core", "core-splashscreen", "1.0.0", "pom", "/")
8    assert maven_path == "gmaven/androidx/core/core-splashscreen/1.0.0/core-splashscreen-1.0.0.pom"
9
10
11def test_artifact_getters():
12    maven_artifact = maven.GMavenArtifact("androidx.core:core-splashscreen:1.0.0:aar")
13    assert maven_artifact.get_pom_file_url() == ("https://maven.google.com/androidx/core/core-"
14                                                 "splashscreen/1.0.0/core-splashscreen-1.0.0.pom")
15    assert maven_artifact.get_artifact_url() == ("https://maven.google.com/androidx/core/core-"
16                                                 "splashscreen/1.0.0/core-splashscreen-1.0.0.aar")
17
18
19if __name__ == "__main__":
20    test_maven_path_for_artifact()
21    test_artifact_getters()
22