Skip to content

Commit

Permalink
tests: update the get_license cases where superflore was guessing
Browse files Browse the repository at this point in the history
* 'Apache' doesn't always mean version 1 in 'Apache-1.0'
* 'GPL' doesn't always mean version 1 in 'GPL-1'
* 'Mozilla Public License' doesn't always mean version 2.0 in 'MPL-2.0'
* 'BSD License 2.0' doesn't always mean clause-2 in 'BSD-2'
* 'Creative Commons' doesn't always mean Creative Commons Attribution Share Alike 3.0 in 'CC-BY-SA-3.0'

* to be safe leave the orignal value and catkin_pkg package.xml validation
  will hopefully notify component developer to better specify the version
  based on the real source files - instead of superflore guessing what was
  meant by that

* fixes:
  #271

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
  • Loading branch information
shr-project committed Sep 18, 2020
1 parent cbf552a commit 2c086ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/test_ebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@ def test_issue_117(self):
got_text = ebuild.get_ebuild_text('Open Source Robotics Foundation', 'BSD')
# grab the license line
license_line = [line for line in got_text.split('\n') if "LICENSE" in line][0]
self.assertEqual(license_line, 'LICENSE="( BSD LGPL-2 Apache-2.0 )"')
self.assertEqual(license_line, 'LICENSE="( BSD LGPL Apache-2.0 )"')
10 changes: 5 additions & 5 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_get_license(self):
ret = get_license('Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)')
self.assertEqual(ret, 'Apache-2.0')
ret = get_license('Apache')
self.assertEqual(ret, 'Apache-1.0')
self.assertEqual(ret, 'Apache')
ret = get_license('BSD-3')
self.assertEqual(ret, 'BSD')
ret = get_license('Apache-2')
Expand All @@ -109,21 +109,21 @@ def test_get_license(self):
ret = get_license('Public Domain')
self.assertEqual(ret, 'public_domain')
ret = get_license('GPL')
self.assertEqual(ret, 'GPL-1')
self.assertEqual(ret, 'GPL')
ret = get_license('GNU GENERAL PUBLIC LICENSE Version 3')
self.assertEqual(ret, 'GPL-3')
ret = get_license('GNU Lesser Public License 2.1')
self.assertEqual(ret, 'LGPL-2.1')
ret = get_license('Mozilla Public License Version 1.1')
self.assertEqual(ret, 'MPL-1.1')
ret = get_license('Mozilla Public License')
self.assertEqual(ret, 'MPL-2.0')
self.assertEqual(ret, 'Mozilla Public License')
ret = get_license('BSD License 2.0')
self.assertEqual(ret, 'BSD-2')
self.assertEqual(ret, 'BSD License 2.0')
ret = get_license('MIT')
self.assertEqual(ret, 'MIT')
ret = get_license('Creative Commons')
self.assertEqual(ret, 'CC-BY-SA-3.0')
self.assertEqual(ret, 'Creative Commons')
ret = get_license('United States Government Purpose')
self.assertEqual(ret, 'United States Government Purpose')

Expand Down

0 comments on commit 2c086ab

Please sign in to comment.