Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Feb 9, 2024
1 parent 23cc27a commit 75c5cee
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
ignore = E203, E266, E501, W503, W605
ignore = E203, E266, E501, W503, W605, C901
max-line-length = 79
max-complexity = 18
select = B,C,E,F,W,T4,B9
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
pip install ".[dev]"
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --exit-zero --statistics
flake8 . --count --show-source --exit-zero --statistics
- name: Test with pytest
run: |
pytest --cov=vdb test
Expand Down
2 changes: 2 additions & 0 deletions test/test_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ def test_convert2(test_cve_wconfig_json):
data = cvesource.convert(data)
assert len(data) == 1


def test_nvd_api_convert(test_nvd_api_json1, test_nvd_api_json2, test_nvd_api_json3):
nvdlatest = NvdSource()
data = nvdlatest.convert(test_nvd_api_json1)
Expand All @@ -408,6 +409,7 @@ def test_nvd_api_convert(test_nvd_api_json1, test_nvd_api_json2, test_nvd_api_js
data = cvesource.convert(data)
assert len(data) == 0


@pytest.mark.skip(reason="This downloads and tests with live data")
def test_nvd_download():
nvdlatest = NvdSource()
Expand Down
3 changes: 2 additions & 1 deletion vdb/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import orjson
import os
import re
import tempfile
from abc import ABCMeta, abstractmethod
from datetime import datetime
from enum import Enum

import orjson

# Known application package types
KNOWN_PKG_TYPES = [
"composer",
Expand Down
2 changes: 1 addition & 1 deletion vdb/lib/aqua.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from zipfile import ZipFile

import httpx
import orjson

from vdb.lib import CustomNamedTemporaryFile, config
from vdb.lib.nvd import NvdSource
Expand All @@ -21,7 +22,6 @@
# Size of the stream to read and write to the file
DOWNLOAD_CHUNK_SIZE = 4096

import orjson

threat_to_severity = {
"unspecified": "LOW",
Expand Down
2 changes: 1 addition & 1 deletion vdb/lib/osv.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from zipfile import ZipFile

import httpx
import orjson
from semver import Version

from vdb.lib import CustomNamedTemporaryFile, config
Expand All @@ -21,7 +22,6 @@
# Size of the stream to read and write to the file
DOWNLOAD_CHUNK_SIZE = 4096

import orjson

vendor_overrides = {
"apk": "alpine",
Expand Down

0 comments on commit 75c5cee

Please sign in to comment.