use of com.google.copybara.ModuleSet in project copybara by google.
the class GitOriginTest method checkPartialFetchGitRepoName.
@Test
public void checkPartialFetchGitRepoName() throws Exception {
String migrationName = "test_name";
ModuleSet moduleSet = skylark.createModuleSet();
for (Object module : moduleSet.getModules().values()) {
// We mutate the module per file loaded. Not ideal but it is the best we can do.
if (module instanceof LabelsAwareModule) {
LabelsAwareModule m = (LabelsAwareModule) module;
m.setWorkflowName(migrationName);
}
}
origin = skylark.evalWithModuleSet("result", "result = git.origin(\n" + " url = 'https://my-server.org/copybara',\n" + " partial_fetch = True" + ")", moduleSet);
Path gitDir = origin.getRepository().getGitDir();
assertThat(gitDir.getFileName().toString()).isEqualTo("copy%2Ebara%2Esky%3A" + migrationName + "https%3A%2F%2Fmy-server%2Eorg%2Fcopybara");
}
Aggregations