Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
The Universal Packaging Tool
upt
Commits
e02dea12
Commit
e02dea12
authored
Mar 04, 2018
by
Cyril Roelandt
Browse files
upt.licenses.License: add __eq__.
parent
d9cd519e
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
e02dea12
...
...
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
Based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
- upt.licenses.License: add __eq__ so that comparisons do not fail
## [0.2.1] - 2018-03-04
### Added
- upt.licenses: Add the OpenSSL license
...
...
upt/licenses.py
View file @
e02dea12
...
...
@@ -21,6 +21,9 @@ class License(object):
def
is_dfsg_compatible
(
self
):
return
False
def
__eq__
(
self
,
other
):
return
self
.
spdx_identifier
==
other
.
spdx_identifier
class
OSIApprovedLicense
(
License
):
def
is_osi_approved
(
self
):
...
...
upt/tests/test_licenses.py
View file @
e02dea12
...
...
@@ -71,3 +71,10 @@ class TestLicenses(unittest.TestCase):
match_fn
.
return_value
=
match
self
.
assertIsInstance
(
licenses
.
guess_from_file
(
'/some/path'
),
licenses
.
BSDThreeClauseLicense
)
def
test_equality
(
self
):
self
.
assertEqual
(
licenses
.
BSDThreeClauseLicense
(),
licenses
.
BSDThreeClauseLicense
())
self
.
assertNotEqual
(
licenses
.
BSDTwoClauseLicense
(),
licenses
.
BSDThreeClauseLicense
())
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment