Skip to content

Commit

Permalink
fix: Add a ~= to the testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
aikebah committed Aug 27, 2023
1 parent ab35d98 commit 351a550
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,25 @@ public void testAnalyzePackageJson() throws Exception {
engine.addDependency(result);
analyzer.analyze(result, engine);
assertFalse(ArrayUtils.contains(engine.getDependencies(), result));
assertEquals(23, engine.getDependencies().length);
boolean found = false;
assertEquals(24, engine.getDependencies().length);
boolean foundPyYAML = false;
boolean foundCryptography = false;
for (Dependency d : engine.getDependencies()) {
if ("PyYAML".equals(d.getName())) {
found = true;
foundPyYAML = true;
assertEquals("3.12", d.getVersion());
assertThat(d.getDisplayFileName(), equalTo("PyYAML:3.12"));
assertEquals(PythonDistributionAnalyzer.DEPENDENCY_ECOSYSTEM, d.getEcosystem());
}
if ("cryptography".equals(d.getName())) {
foundCryptography = true;
assertEquals("1.8.2", d.getVersion());
assertThat(d.getDisplayFileName(), equalTo("cryptography:1.8.2"));
assertEquals(PythonDistributionAnalyzer.DEPENDENCY_ECOSYSTEM, d.getEcosystem());
}
}
assertTrue("Expeced to find PyYAML", found);
assertTrue("Expected to find PyYAML", foundPyYAML);
assertTrue("Expected to find cryptography", foundCryptography);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,25 @@ public void testAnalyzePackageJson() throws Exception {
engine.addDependency(result);
analyzer.analyze(result, engine);
assertFalse(ArrayUtils.contains(engine.getDependencies(), result));
assertEquals(39, engine.getDependencies().length);
boolean found = false;
assertEquals(40, engine.getDependencies().length);
boolean foundUrllib3 = false;
boolean foundCryptography = false;
for (Dependency d : engine.getDependencies()) {
if ("urllib3".equals(d.getName())) {
found = true;
foundUrllib3 = true;
assertEquals("1.25.9", d.getVersion());
assertThat(d.getDisplayFileName(), equalTo("urllib3:1.25.9"));
assertEquals(PythonDistributionAnalyzer.DEPENDENCY_ECOSYSTEM, d.getEcosystem());
}
if ("cryptography".equals(d.getName())) {
foundCryptography = true;
assertEquals("1.8.2", d.getVersion());
assertThat(d.getDisplayFileName(), equalTo("cryptography:1.8.2"));
assertEquals(PythonDistributionAnalyzer.DEPENDENCY_ECOSYSTEM, d.getEcosystem());
}
}
assertTrue("Expeced to find urllib3", found);
assertTrue("Expeced to find urllib3", foundUrllib3);
assertTrue("Expeced to find cryptography", foundCryptography);
}
}
}
1 change: 1 addition & 0 deletions src/test/resources/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ py-flags = "==1.1.2"
CacheControl = "==0.12.5"
prometheus_client = "==0.7.1"
PyYAML = "==5.3.1"
cryptography = "~=1.8.2"

[requires]
python_version = "3.6"
3 changes: 2 additions & 1 deletion src/test/resources/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ six==1.11.0
spyne==2.12.14
suds-jurko==0.6
urllib3
Werkzeug>=0.14.1
Werkzeug>=0.14.1
cryptography~=1.8.2

0 comments on commit 351a550

Please sign in to comment.