Search in sources :

Example 6 with PipFreeze

use of com.synopsys.integration.detectable.detectables.pipenv.build.model.PipFreeze in project synopsys-detect by blackducksoftware.

the class PipenvTransformerTest method ignoresNonProject.

@Test
void ignoresNonProject() {
    PipFreeze pipFreeze = new PipFreeze(new ArrayList<>());
    List<PipenvGraphEntry> pipenvGraphEntries = new ArrayList<>();
    pipenvGraphEntries.add(new PipenvGraphEntry("projectName", "projectVersion", Collections.singletonList(new PipenvGraphDependency("child", "childVersion", Collections.emptyList()))));
    pipenvGraphEntries.add(new PipenvGraphEntry("non-projectName", "non-projectVersion", new ArrayList<>()));
    PipenvGraph pipenvGraph = new PipenvGraph(pipenvGraphEntries);
    PipenvTransformer pipenvTransformer = new PipenvTransformer(new ExternalIdFactory());
    CodeLocation codeLocation = pipenvTransformer.transform("projectName", "projectVersion", pipFreeze, pipenvGraph, true);
    DependencyGraph graph = codeLocation.getDependencyGraph();
    NameVersionGraphAssert graphAssert = new NameVersionGraphAssert(Forge.PYPI, graph);
    graphAssert.hasRootDependency("child", "childVersion");
    graphAssert.hasNoDependency("non-projectName", "non-projectVersion");
}
Also used : PipenvTransformer(com.synopsys.integration.detectable.detectables.pipenv.build.parser.PipenvTransformer) PipenvGraphEntry(com.synopsys.integration.detectable.detectables.pipenv.build.model.PipenvGraphEntry) CodeLocation(com.synopsys.integration.detectable.detectable.codelocation.CodeLocation) PipenvGraphDependency(com.synopsys.integration.detectable.detectables.pipenv.build.model.PipenvGraphDependency) ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) ArrayList(java.util.ArrayList) NameVersionGraphAssert(com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert) DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) PipenvGraph(com.synopsys.integration.detectable.detectables.pipenv.build.model.PipenvGraph) PipFreeze(com.synopsys.integration.detectable.detectables.pipenv.build.model.PipFreeze) Test(org.junit.jupiter.api.Test) UnitTest(com.synopsys.integration.detectable.annotations.UnitTest)

Aggregations

PipFreeze (com.synopsys.integration.detectable.detectables.pipenv.build.model.PipFreeze)6 UnitTest (com.synopsys.integration.detectable.annotations.UnitTest)5 CodeLocation (com.synopsys.integration.detectable.detectable.codelocation.CodeLocation)5 PipenvGraph (com.synopsys.integration.detectable.detectables.pipenv.build.model.PipenvGraph)5 ArrayList (java.util.ArrayList)5 Test (org.junit.jupiter.api.Test)5 DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)4 ExternalIdFactory (com.synopsys.integration.bdio.model.externalid.ExternalIdFactory)4 PipenvGraphEntry (com.synopsys.integration.detectable.detectables.pipenv.build.model.PipenvGraphEntry)4 PipenvTransformer (com.synopsys.integration.detectable.detectables.pipenv.build.parser.PipenvTransformer)4 NameVersionGraphAssert (com.synopsys.integration.detectable.util.graph.NameVersionGraphAssert)4 PipFreezeEntry (com.synopsys.integration.detectable.detectables.pipenv.build.model.PipFreezeEntry)2 PipenvGraphDependency (com.synopsys.integration.detectable.detectables.pipenv.build.model.PipenvGraphDependency)2 PipenvFreezeParser (com.synopsys.integration.detectable.detectables.pipenv.build.parser.PipenvFreezeParser)1 Extraction (com.synopsys.integration.detectable.extraction.Extraction)1 ExecutableOutput (com.synopsys.integration.executable.ExecutableOutput)1 ExecutableRunnerException (com.synopsys.integration.executable.ExecutableRunnerException)1