Skip to content

Commit

Permalink
Merge branch 'master' into nicholas/support-advisory-multiline
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelpivato authored Jan 11, 2021
2 parents c0d27c0 + e09d12f commit ad34959
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ History
-------------------

* Provide CVSS scores on full report, when available
* Fixed used DB wrong info
* Support line breaks on advisories

1.10.1 (2021-01-03)
Expand Down
6 changes: 3 additions & 3 deletions safety/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@ def render_licenses(packages_licenses):

def get_used_db(key, db):
key = key if key else os.environ.get("SAFETY_API_KEY", False)
if db:
return "local DB"
if key:
return "pyup.io's DB"
if db == '':
return 'default DB'
return "local DB"
return "free DB (updated once a month)"


def report(vulns, full=False, json_report=False, bare_report=False, checked_packages=0, db=None, key=None):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def test_report_json(self):
assert json.loads(json_report) == test_arr

def test_get_used_db(self):
assert 'default DB' == formatter.get_used_db(key=None, db='')
assert 'free DB (updated once a month)' == formatter.get_used_db(key=None, db='')
assert 'pyup.io\'s DB' == formatter.get_used_db(key='foo', db='')
assert 'local DB' == formatter.get_used_db(key=None, db='/usr/local/some-db')

Expand Down

0 comments on commit ad34959

Please sign in to comment.