use of com.synopsys.integration.detectable.detectables.conda.parser.CondaListParser in project synopsys-detect by blackducksoftware.
the class CondaListParserTest method testForgesCorrectlyAssigned.
@Test
public void testForgesCorrectlyAssigned() throws IOException {
ExternalIdFactory externalIdFactory = new ExternalIdFactory();
CondaDependencyCreator dependencyCreator = new CondaDependencyCreator(externalIdFactory);
CondaListParser condaListParser = new CondaListParser(new Gson(), dependencyCreator);
File condaListFile = FunctionalTestFiles.asFile("/conda/condaListWithPypiAndCondaComponents.txt");
String condaListText = FileUtils.readFileToString(condaListFile, StandardCharsets.UTF_8);
DependencyGraph dependencyGraph = condaListParser.parse(condaListText, "{\n\"platform\":\"test\"\n}");
ExternalId treeliteRuntimeExternalId = externalIdFactory.createNameVersionExternalId(Forge.PYPI, "treelite-runtime", "2.0.0");
assertTrue(dependencyGraph.getRootDependencies().stream().map(Dependency::getExternalId).anyMatch(treeliteRuntimeExternalId::equals));
ExternalId tkExternalId = externalIdFactory.createNameVersionExternalId(Forge.ANACONDA, "tk", "8.6.11-h5dbffcc_1-test");
assertTrue(dependencyGraph.getRootDependencies().stream().map(Dependency::getExternalId).anyMatch(tkExternalId::equals));
}
Aggregations