use of com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockTransformer in project synopsys-detect by blackducksoftware.
the class DetectableFactory method createPipfileLockDetectable.
public PipfileLockDetectable createPipfileLockDetectable(DetectableEnvironment environment, PipfileLockDetectableOptions pipfileLockDetectableOptions) {
PipfileLockDependencyVersionParser dependencyVersionParser = new PipfileLockDependencyVersionParser();
PipfileLockTransformer pipfileLockTransformer = new PipfileLockTransformer(dependencyVersionParser, pipfileLockDetectableOptions.getDependencyTypeFilter());
PipfileLockDependencyTransformer pipfileLockDependencyTransformer = new PipfileLockDependencyTransformer();
PipfileLockExtractor pipfileLockExtractor = new PipfileLockExtractor(gson, pipfileLockTransformer, pipfileLockDependencyTransformer);
return new PipfileLockDetectable(environment, fileFinder, pipfileLockExtractor);
}
use of com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockTransformer in project synopsys-detect by blackducksoftware.
the class PipfileLockParserTest method testParse.
@Test
public void testParse() {
PipfileLock pipfileLock = pipfileLock();
PipfileLockDependencyVersionParser dependencyVersionParser = new PipfileLockDependencyVersionParser();
PipfileLockTransformer parser = new PipfileLockTransformer(dependencyVersionParser, EnumListFilter.excludeNone());
List<PipfileLockDependency> dependencies = parser.transform(pipfileLock);
Assertions.assertEquals(3, dependencies.size());
Assertions.assertTrue(containsDependency(dependencies, "comp1", "1.0"));
Assertions.assertTrue(containsDependency(dependencies, "comp2", null));
Assertions.assertTrue(containsDependency(dependencies, "comp3", "3.0"));
}
use of com.synopsys.integration.detectable.detectables.pipenv.parse.PipfileLockTransformer in project synopsys-detect by blackducksoftware.
the class PipfileLockParserTest method testExcludeDevelopDependencies.
@Test
public void testExcludeDevelopDependencies() {
PipfileLock pipfileLock = pipfileLock();
PipfileLockDependencyVersionParser dependencyVersionParser = new PipfileLockDependencyVersionParser();
PipfileLockTransformer parser = new PipfileLockTransformer(dependencyVersionParser, EnumListFilter.fromExcluded(PipenvDependencyType.DEV));
List<PipfileLockDependency> dependencies = parser.transform(pipfileLock);
Assertions.assertEquals(2, dependencies.size());
Assertions.assertTrue(containsDependency(dependencies, "comp1", "1.0"));
Assertions.assertTrue(containsDependency(dependencies, "comp2", null));
Assertions.assertFalse(containsDependency(dependencies, "comp3", "3.0"));
}
Aggregations