Skip to content

Commit f8b5448

Browse files
committed
Merge remote-tracking branch 'origin/22_collect_redistributable_src'
into develop
2 parents eb1a2fa + 14819d5 commit f8b5448

File tree

9 files changed

+55
-6
lines changed

9 files changed

+55
-6
lines changed

docs/CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Fixed #443 and #444 issue with multiple licenses/license_files
66
* Fixed #442 no special characters allowed for `license_key`, `license_name` and `license_expression`
77
* Fixed #446 Better error handling
8+
* Add support to collect redistributable sources #22
89

910
2020-08-11
1011
Release 5.0.0

tests/test_util.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,3 +628,37 @@ def test_copy_license_notice_files(self):
628628
assert len(licenses) == len(copied_files)
629629
for license in licenses:
630630
assert license in copied_files
631+
632+
def test_copy_file(self):
633+
des = get_temp_dir()
634+
test_file = get_test_loc('test_util/licenses/mit.LICENSE')
635+
licenses = ['mit.LICENSE']
636+
err = util.copy_file(test_file, des)
637+
from os import listdir
638+
copied_files = listdir(des)
639+
assert len(licenses) == len(copied_files)
640+
assert err == []
641+
for license in licenses:
642+
assert license in copied_files
643+
644+
def test_copy_file_with_dir(self):
645+
des = get_temp_dir()
646+
test_dir = get_test_loc('test_util/licenses/')
647+
licenses = ['mit.LICENSE', 'mit2.LICENSE', 'public-domain.LICENSE']
648+
err = util.copy_file(test_dir, des)
649+
assert err == []
650+
651+
import os
652+
files_list = []
653+
dir_list = []
654+
# Get the directories and files in the 'des' recursively
655+
for root, dir, files in os.walk(des):
656+
for d in dir:
657+
dir_list.append(d)
658+
for f in files:
659+
files_list.append(f)
660+
661+
#assert dir_list == [u'licenses']
662+
assert len(licenses) == len(files_list)
663+
for license in licenses:
664+
assert license in files_list

tests/testdata/test_cmd/help/about_help.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ Options:
1313
-h, --help Show this message and exit.
1414

1515
Commands:
16-
attrib Generate an attribution document from .ABOUT files.
17-
check Validate that the format of .ABOUT files is correct and report
18-
errors and warnings.
19-
gen Generate .ABOUT files from an inventory as CSV or JSON.
20-
inventory Collect the inventory of .ABOUT files to a CSV or JSON file.
21-
transform Transform a CSV/JSON by applying renamings, filters and checks.
16+
attrib Generate an attribution document from .ABOUT files.
17+
check Validate that the format of .ABOUT files is correct and
18+
report errors and warnings.
19+
collect_redist_src Collect redistributable sources.
20+
gen Generate .ABOUT files from an inventory as CSV or JSON.
21+
inventory Collect the inventory of .ABOUT files to a CSV or JSON
22+
file.
23+
transform Transform a CSV/JSON by applying renamings, filters and
24+
checks.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
about_resource: .
2+
name: test
3+
redistribute: x

tests/testdata/test_model/redistribution/test/subdir/test.c

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
about_resource: this.c
2+
version: 0.11.0
3+
name: this.c
4+
redistribute: x

tests/testdata/test_model/redistribution/this.c

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
about_resource: this2.c
2+
name: this2.c
3+
version: 0.11.0
4+
redistribute: N

tests/testdata/test_model/redistribution/this2.c

Whitespace-only changes.

0 commit comments

Comments
 (0)