File tree Expand file tree Collapse file tree 9 files changed +55
-6
lines changed
test_model/redistribution Expand file tree Collapse file tree 9 files changed +55
-6
lines changed Original file line number Diff line number Diff line change 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
9102020-08-11
1011 Release 5.0.0
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -13,9 +13,12 @@ Options:
1313 -h, --help Show this message and exit.
1414
1515Commands:
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.
Original file line number Diff line number Diff line change 1+ about_resource: .
2+ name: test
3+ redistribute: x
Original file line number Diff line number Diff line change 1+ about_resource: this.c
2+ version: 0.11.0
3+ name: this.c
4+ redistribute: x
Original file line number Diff line number Diff line change 1+ about_resource: this2.c
2+ name: this2.c
3+ version: 0.11.0
4+ redistribute: N
You can’t perform that action at this time.
0 commit comments