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