Skip to content

Commit

Permalink
fix: add missing docstrings
Browse files Browse the repository at this point in the history
Signed-off-by: Terri Oda <[email protected]>
  • Loading branch information
terriko committed Jan 5, 2024
1 parent 763fa1f commit fb2cbb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions cve_bin_tool/version_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def __repr__(self):
return f"Version: {self} aka {parse_version(self)}"

def is_hash(self):
"""Check to see if a version looks like it contains a hash"""
if re.match("[a-fA-F0-9]{8,}", self) is None:
return False
return True
1 change: 1 addition & 0 deletions test/test_version_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,6 @@ def test_error(self):
Version("") > Version("6")

def test_ne(self):
"""Test some != cases with hashes to make sure we aren't comparing the string 'HASH'"""
assert Version("f835f2caab") != Version("f835f2caaa")
assert Version("HASH") != Version("f835f2caaa")

0 comments on commit fb2cbb9

Please sign in to comment.