diff --git a/src/deltacode/__init__.py b/src/deltacode/__init__.py index 7f00bdda..2500b373 100644 --- a/src/deltacode/__init__.py +++ b/src/deltacode/__init__.py @@ -121,7 +121,7 @@ def similarity(self): ) def create_deltas( - self, new_resource, old_resource, new_path, old_path, score, status + self, new_resource, old_resource, score, status ): """ Creates the Delta Objects and appends them to the member list. @@ -153,7 +153,7 @@ def determine_delta(self): ) # If the resource is a file align its path - old_resource = self.codebase2.get_resource_from_path(path_new) + old_resource = self.codebase2.get_resource(path_new) # Check in the old codebase weather a resource with such a path exists or not # if it exists and their corresponding sha's are same then its an unmodified delta @@ -163,7 +163,7 @@ def determine_delta(self): paths.split(old_resource.path)[Delta.OLD_CODEBASE_OFFSET :] ) self.create_deltas( - new_resource, old_resource, path_new, path_old, 0, "unmodified", + new_resource, old_resource, 0, "unmodified", ) self.stats.num_unmodified += 1 @@ -196,8 +196,6 @@ def determine_delta(self): self.create_deltas( new_resource, old_resource, - path_new, - path_old, 0, "unmodified", ) @@ -209,8 +207,6 @@ def determine_delta(self): self.create_deltas( new_resource, old_resource, - path_new, - path_old, 20, "modified", ) @@ -225,8 +221,6 @@ def determine_delta(self): self.create_deltas( new_resource, old_resource, - path_new, - path_old, 0, "moved", ) @@ -236,7 +230,7 @@ def determine_delta(self): if ADDED: # If none of the above criteria matches then the delta is an added one. self.create_deltas( - new_resource, None, path_new, None, 100, "added", + new_resource, None, 100, "added", ) self.stats.num_added += 1 @@ -253,7 +247,7 @@ def determine_delta(self): ] ) self.create_deltas( - None, old_resource_remaining, None, path_old, 0, "removed", + None, old_resource_remaining, 0, "removed", ) self.stats.num_removed += 1 diff --git a/tests/data/deltacode/scan_modified_old_license_added.json b/tests/data/deltacode/scan_modified_old_license_added.json index a50676a0..b317ea88 100644 --- a/tests/data/deltacode/scan_modified_old_license_added.json +++ b/tests/data/deltacode/scan_modified_old_license_added.json @@ -37,7 +37,7 @@ { "path": "some/path/b/b1.py", "type": "file", - "name": "b2.py", + "name": "b1.py", "size": 200, "sha1": "333647771481d39dd3a53f6dc210c26abac37748", "licenses": [ diff --git a/tests/data/utils/update_from_copyright_info_copyright_info_added_new.json b/tests/data/utils/update_from_copyright_info_copyright_info_added_new.json index 3903e303..30010430 100644 --- a/tests/data/utils/update_from_copyright_info_copyright_info_added_new.json +++ b/tests/data/utils/update_from_copyright_info_copyright_info_added_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_copyright_info_added_old.json b/tests/data/utils/update_from_copyright_info_copyright_info_added_old.json index c460c74b..669cbcf9 100644 --- a/tests/data/utils/update_from_copyright_info_copyright_info_added_old.json +++ b/tests/data/utils/update_from_copyright_info_copyright_info_added_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "copyrights": [] diff --git a/tests/data/utils/update_from_copyright_info_copyright_info_removed_new.json b/tests/data/utils/update_from_copyright_info_copyright_info_removed_new.json index b92d6770..e7ed9883 100644 --- a/tests/data/utils/update_from_copyright_info_copyright_info_removed_new.json +++ b/tests/data/utils/update_from_copyright_info_copyright_info_removed_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [] diff --git a/tests/data/utils/update_from_copyright_info_copyright_info_removed_old.json b/tests/data/utils/update_from_copyright_info_copyright_info_removed_old.json index eb8aabec..d3b2478a 100644 --- a/tests/data/utils/update_from_copyright_info_copyright_info_removed_old.json +++ b/tests/data/utils/update_from_copyright_info_copyright_info_removed_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_file_added_one_copyright_new.json b/tests/data/utils/update_from_copyright_info_file_added_one_copyright_new.json index d9259c75..5a3d43ff 100644 --- a/tests/data/utils/update_from_copyright_info_file_added_one_copyright_new.json +++ b/tests/data/utils/update_from_copyright_info_file_added_one_copyright_new.json @@ -19,6 +19,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_no_copyright_changes_new.json b/tests/data/utils/update_from_copyright_info_no_copyright_changes_new.json index 3903e303..30010430 100644 --- a/tests/data/utils/update_from_copyright_info_no_copyright_changes_new.json +++ b/tests/data/utils/update_from_copyright_info_no_copyright_changes_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_no_copyright_changes_old.json b/tests/data/utils/update_from_copyright_info_no_copyright_changes_old.json index eb8aabec..d3b2478a 100644 --- a/tests/data/utils/update_from_copyright_info_no_copyright_changes_old.json +++ b/tests/data/utils/update_from_copyright_info_no_copyright_changes_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_no_copyright_key_value_new.json b/tests/data/utils/update_from_copyright_info_no_copyright_key_value_new.json index 5ff4d935..fa202518 100644 --- a/tests/data/utils/update_from_copyright_info_no_copyright_key_value_new.json +++ b/tests/data/utils/update_from_copyright_info_no_copyright_key_value_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "" } diff --git a/tests/data/utils/update_from_copyright_info_no_copyright_key_value_old.json b/tests/data/utils/update_from_copyright_info_no_copyright_key_value_old.json index 45e4d858..a41f3835 100644 --- a/tests/data/utils/update_from_copyright_info_no_copyright_key_value_old.json +++ b/tests/data/utils/update_from_copyright_info_no_copyright_key_value_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "" } diff --git a/tests/data/utils/update_from_copyright_info_non_modified_new.json b/tests/data/utils/update_from_copyright_info_non_modified_new.json index 65e3e23d..e1ef962f 100644 --- a/tests/data/utils/update_from_copyright_info_non_modified_new.json +++ b/tests/data/utils/update_from_copyright_info_non_modified_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_non_modified_old.json b/tests/data/utils/update_from_copyright_info_non_modified_old.json index 65e3e23d..e1ef962f 100644 --- a/tests/data/utils/update_from_copyright_info_non_modified_old.json +++ b/tests/data/utils/update_from_copyright_info_non_modified_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_one_copyright_added_new.json b/tests/data/utils/update_from_copyright_info_one_copyright_added_new.json index edb4c9b5..c6995f3b 100644 --- a/tests/data/utils/update_from_copyright_info_one_copyright_added_new.json +++ b/tests/data/utils/update_from_copyright_info_one_copyright_added_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_one_copyright_added_old.json b/tests/data/utils/update_from_copyright_info_one_copyright_added_old.json index eb8aabec..d3b2478a 100644 --- a/tests/data/utils/update_from_copyright_info_one_copyright_added_old.json +++ b/tests/data/utils/update_from_copyright_info_one_copyright_added_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_one_copyright_removed_new.json b/tests/data/utils/update_from_copyright_info_one_copyright_removed_new.json index 3903e303..30010430 100644 --- a/tests/data/utils/update_from_copyright_info_one_copyright_removed_new.json +++ b/tests/data/utils/update_from_copyright_info_one_copyright_removed_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_one_copyright_removed_old.json b/tests/data/utils/update_from_copyright_info_one_copyright_removed_old.json index 172ff832..3e3ae34a 100644 --- a/tests/data/utils/update_from_copyright_info_one_copyright_removed_old.json +++ b/tests/data/utils/update_from_copyright_info_one_copyright_removed_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_single_copyright_change_holders_only_new.json b/tests/data/utils/update_from_copyright_info_single_copyright_change_holders_only_new.json index 65e3e23d..e1ef962f 100644 --- a/tests/data/utils/update_from_copyright_info_single_copyright_change_holders_only_new.json +++ b/tests/data/utils/update_from_copyright_info_single_copyright_change_holders_only_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_single_copyright_change_holders_only_old.json b/tests/data/utils/update_from_copyright_info_single_copyright_change_holders_only_old.json index 1a3bc5a3..d7ec98b9 100644 --- a/tests/data/utils/update_from_copyright_info_single_copyright_change_holders_only_old.json +++ b/tests/data/utils/update_from_copyright_info_single_copyright_change_holders_only_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_single_copyright_change_new.json b/tests/data/utils/update_from_copyright_info_single_copyright_change_new.json index 33e7df92..9b112509 100644 --- a/tests/data/utils/update_from_copyright_info_single_copyright_change_new.json +++ b/tests/data/utils/update_from_copyright_info_single_copyright_change_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_single_copyright_change_old.json b/tests/data/utils/update_from_copyright_info_single_copyright_change_old.json index eb8aabec..d3b2478a 100644 --- a/tests/data/utils/update_from_copyright_info_single_copyright_change_old.json +++ b/tests/data/utils/update_from_copyright_info_single_copyright_change_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_single_copyright_change_statements_only_new.json b/tests/data/utils/update_from_copyright_info_single_copyright_change_statements_only_new.json index b8ff5ad2..f010fcae 100644 --- a/tests/data/utils/update_from_copyright_info_single_copyright_change_statements_only_new.json +++ b/tests/data/utils/update_from_copyright_info_single_copyright_change_statements_only_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_copyright_info_single_copyright_change_statements_only_old.json b/tests/data/utils/update_from_copyright_info_single_copyright_change_statements_only_old.json index a141b9ef..b1e23289 100644 --- a/tests/data/utils/update_from_copyright_info_single_copyright_change_statements_only_old.json +++ b/tests/data/utils/update_from_copyright_info_single_copyright_change_statements_only_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "copyrights": [ diff --git a/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_added_new.json b/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_added_new.json index 82777d0e..8d41f748 100644 --- a/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_added_new.json +++ b/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_added_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_added_old.json b/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_added_old.json index db767e4b..962312b4 100644 --- a/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_added_old.json +++ b/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_added_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [], diff --git a/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_removed_new.json b/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_removed_new.json index 6e36d9dd..89af3b9d 100644 --- a/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_removed_new.json +++ b/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_removed_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [], diff --git a/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_removed_old.json b/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_removed_old.json index b9afdbbb..3af4f034 100644 --- a/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_removed_old.json +++ b/tests/data/utils/update_from_lic_copy_info_copyright_and_license_info_removed_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_copyright_change_no_license_change_new.json b/tests/data/utils/update_from_lic_copy_info_copyright_change_no_license_change_new.json index f763334c..d9832c66 100644 --- a/tests/data/utils/update_from_lic_copy_info_copyright_change_no_license_change_new.json +++ b/tests/data/utils/update_from_lic_copy_info_copyright_change_no_license_change_new.json @@ -11,6 +11,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_copyright_change_no_license_change_old.json b/tests/data/utils/update_from_lic_copy_info_copyright_change_no_license_change_old.json index 93a4dfe9..e672edeb 100644 --- a/tests/data/utils/update_from_lic_copy_info_copyright_change_no_license_change_old.json +++ b/tests/data/utils/update_from_lic_copy_info_copyright_change_no_license_change_old.json @@ -11,6 +11,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_copyright_info_added_license_info_removed_new.json b/tests/data/utils/update_from_lic_copy_info_copyright_info_added_license_info_removed_new.json index a15ef7d9..fd44ac37 100644 --- a/tests/data/utils/update_from_lic_copy_info_copyright_info_added_license_info_removed_new.json +++ b/tests/data/utils/update_from_lic_copy_info_copyright_info_added_license_info_removed_new.json @@ -11,6 +11,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [], diff --git a/tests/data/utils/update_from_lic_copy_info_copyright_info_added_license_info_removed_old.json b/tests/data/utils/update_from_lic_copy_info_copyright_info_added_license_info_removed_old.json index f63d8697..778c9045 100644 --- a/tests/data/utils/update_from_lic_copy_info_copyright_info_added_license_info_removed_old.json +++ b/tests/data/utils/update_from_lic_copy_info_copyright_info_added_license_info_removed_old.json @@ -11,6 +11,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_commercial_and_copyleft_licenses_new.json b/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_commercial_and_copyleft_licenses_new.json index 342a4a28..bb64c98a 100644 --- a/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_commercial_and_copyleft_licenses_new.json +++ b/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_commercial_and_copyleft_licenses_new.json @@ -8,17 +8,10 @@ }, "files_count": 2, "files": [ - { - "path":"test", - "name": "path", - "sha1": "c", - "original_path": "", - "licenses": [], - "copyrights": [] - }, { "path":"/test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_commercial_and_copyleft_licenses_old.json b/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_commercial_and_copyleft_licenses_old.json index c7175031..0df47180 100644 --- a/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_commercial_and_copyleft_licenses_old.json +++ b/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_commercial_and_copyleft_licenses_old.json @@ -11,6 +11,7 @@ { "path":"test", "name": "path", + "type": "directory", "sha1": "c", "original_path": "", "licenses": [], diff --git a/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_permissive_license_new.json b/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_permissive_license_new.json index 76143963..0f2fad1c 100644 --- a/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_permissive_license_new.json +++ b/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_permissive_license_new.json @@ -19,6 +19,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_permissive_license_old.json b/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_permissive_license_old.json index de501a04..0fb01645 100644 --- a/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_permissive_license_old.json +++ b/tests/data/utils/update_from_lic_copy_info_file_added_copyright_and_permissive_license_old.json @@ -11,6 +11,7 @@ { "path":"test", "name": "test", + "type": "directory", "sha1": "b", "original_path": "", "licenses": [], diff --git a/tests/data/utils/update_from_lic_copy_info_license_change_no_copyright_change_new.json b/tests/data/utils/update_from_lic_copy_info_license_change_no_copyright_change_new.json index f682d082..2c4bfff7 100644 --- a/tests/data/utils/update_from_lic_copy_info_license_change_no_copyright_change_new.json +++ b/tests/data/utils/update_from_lic_copy_info_license_change_no_copyright_change_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_license_change_no_copyright_change_old.json b/tests/data/utils/update_from_lic_copy_info_license_change_no_copyright_change_old.json index 5dc99a55..d969ed3c 100644 --- a/tests/data/utils/update_from_lic_copy_info_license_change_no_copyright_change_old.json +++ b/tests/data/utils/update_from_lic_copy_info_license_change_no_copyright_change_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_license_info_added_copyright_info_removed_new.json b/tests/data/utils/update_from_lic_copy_info_license_info_added_copyright_info_removed_new.json index ff60bea5..21e903e9 100644 --- a/tests/data/utils/update_from_lic_copy_info_license_info_added_copyright_info_removed_new.json +++ b/tests/data/utils/update_from_lic_copy_info_license_info_added_copyright_info_removed_new.json @@ -11,6 +11,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_lic_copy_info_license_info_added_copyright_info_removed_old.json b/tests/data/utils/update_from_lic_copy_info_license_info_added_copyright_info_removed_old.json index e622dcb6..9657bc9b 100644 --- a/tests/data/utils/update_from_lic_copy_info_license_info_added_copyright_info_removed_old.json +++ b/tests/data/utils/update_from_lic_copy_info_license_info_added_copyright_info_removed_old.json @@ -11,6 +11,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [], diff --git a/tests/data/utils/update_from_license_info_copyleft_license_info_added_new.json b/tests/data/utils/update_from_license_info_copyleft_license_info_added_new.json index 40b45f87..ecc0f525 100644 --- a/tests/data/utils/update_from_license_info_copyleft_license_info_added_new.json +++ b/tests/data/utils/update_from_license_info_copyleft_license_info_added_new.json @@ -11,6 +11,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_copyleft_license_info_added_old.json b/tests/data/utils/update_from_license_info_copyleft_license_info_added_old.json index 9fba96ab..b7ae6ab1 100644 --- a/tests/data/utils/update_from_license_info_copyleft_license_info_added_old.json +++ b/tests/data/utils/update_from_license_info_copyleft_license_info_added_old.json @@ -11,6 +11,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [] diff --git a/tests/data/utils/update_from_license_info_copyleft_license_info_removed_new.json b/tests/data/utils/update_from_license_info_copyleft_license_info_removed_new.json index a419ea18..4f34ea2f 100644 --- a/tests/data/utils/update_from_license_info_copyleft_license_info_removed_new.json +++ b/tests/data/utils/update_from_license_info_copyleft_license_info_removed_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [] diff --git a/tests/data/utils/update_from_license_info_copyleft_license_info_removed_old.json b/tests/data/utils/update_from_license_info_copyleft_license_info_removed_old.json index 80c80d11..f63838af 100644 --- a/tests/data/utils/update_from_license_info_copyleft_license_info_removed_old.json +++ b/tests/data/utils/update_from_license_info_copyleft_license_info_removed_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_copyleft_to_copyleft_limited_new.json b/tests/data/utils/update_from_license_info_copyleft_to_copyleft_limited_new.json index e0c8c9c4..eb2e40bc 100644 --- a/tests/data/utils/update_from_license_info_copyleft_to_copyleft_limited_new.json +++ b/tests/data/utils/update_from_license_info_copyleft_to_copyleft_limited_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_copyleft_to_copyleft_limited_old.json b/tests/data/utils/update_from_license_info_copyleft_to_copyleft_limited_old.json index 80c80d11..f63838af 100644 --- a/tests/data/utils/update_from_license_info_copyleft_to_copyleft_limited_old.json +++ b/tests/data/utils/update_from_license_info_copyleft_to_copyleft_limited_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_copyleft_to_different_copyleft_new.json b/tests/data/utils/update_from_license_info_copyleft_to_different_copyleft_new.json index 26c6b3ae..37c78003 100644 --- a/tests/data/utils/update_from_license_info_copyleft_to_different_copyleft_new.json +++ b/tests/data/utils/update_from_license_info_copyleft_to_different_copyleft_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_copyleft_to_different_copyleft_old.json b/tests/data/utils/update_from_license_info_copyleft_to_different_copyleft_old.json index 80c80d11..f63838af 100644 --- a/tests/data/utils/update_from_license_info_copyleft_to_different_copyleft_old.json +++ b/tests/data/utils/update_from_license_info_copyleft_to_different_copyleft_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_no_license_changes_new.json b/tests/data/utils/update_from_license_info_no_license_changes_new.json index dd1822af..d856cf26 100644 --- a/tests/data/utils/update_from_license_info_no_license_changes_new.json +++ b/tests/data/utils/update_from_license_info_no_license_changes_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_no_license_changes_old.json b/tests/data/utils/update_from_license_info_no_license_changes_old.json index 7e801dce..370a87e2 100644 --- a/tests/data/utils/update_from_license_info_no_license_changes_old.json +++ b/tests/data/utils/update_from_license_info_no_license_changes_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_no_license_key_value_new.json b/tests/data/utils/update_from_license_info_no_license_key_value_new.json index 4cb44630..4435445b 100644 --- a/tests/data/utils/update_from_license_info_no_license_key_value_new.json +++ b/tests/data/utils/update_from_license_info_no_license_key_value_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "" } diff --git a/tests/data/utils/update_from_license_info_no_license_key_value_old.json b/tests/data/utils/update_from_license_info_no_license_key_value_old.json index 440a685d..ef48c9d7 100644 --- a/tests/data/utils/update_from_license_info_no_license_key_value_old.json +++ b/tests/data/utils/update_from_license_info_no_license_key_value_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "" } diff --git a/tests/data/utils/update_from_license_info_one_license_added_new.json b/tests/data/utils/update_from_license_info_one_license_added_new.json index ba8ee152..47a0c83c 100644 --- a/tests/data/utils/update_from_license_info_one_license_added_new.json +++ b/tests/data/utils/update_from_license_info_one_license_added_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_one_license_added_old.json b/tests/data/utils/update_from_license_info_one_license_added_old.json index 3a9f094d..44915f29 100644 --- a/tests/data/utils/update_from_license_info_one_license_added_old.json +++ b/tests/data/utils/update_from_license_info_one_license_added_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_one_license_removed_new.json b/tests/data/utils/update_from_license_info_one_license_removed_new.json index 47c2d914..b3d4c4c7 100644 --- a/tests/data/utils/update_from_license_info_one_license_removed_new.json +++ b/tests/data/utils/update_from_license_info_one_license_removed_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_one_license_removed_old.json b/tests/data/utils/update_from_license_info_one_license_removed_old.json index 404a0efe..c494e2da 100644 --- a/tests/data/utils/update_from_license_info_one_license_removed_old.json +++ b/tests/data/utils/update_from_license_info_one_license_removed_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_one_permissive_to_six_copyleft_or_higher_new.json b/tests/data/utils/update_from_license_info_one_permissive_to_six_copyleft_or_higher_new.json index cc7ea68a..cd1e87c7 100644 --- a/tests/data/utils/update_from_license_info_one_permissive_to_six_copyleft_or_higher_new.json +++ b/tests/data/utils/update_from_license_info_one_permissive_to_six_copyleft_or_higher_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_one_permissive_to_six_copyleft_or_higher_old.json b/tests/data/utils/update_from_license_info_one_permissive_to_six_copyleft_or_higher_old.json index 3a9f094d..44915f29 100644 --- a/tests/data/utils/update_from_license_info_one_permissive_to_six_copyleft_or_higher_old.json +++ b/tests/data/utils/update_from_license_info_one_permissive_to_six_copyleft_or_higher_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_one_permissive_to_two_permissives_new.json b/tests/data/utils/update_from_license_info_one_permissive_to_two_permissives_new.json index 79f3c28c..b604b481 100644 --- a/tests/data/utils/update_from_license_info_one_permissive_to_two_permissives_new.json +++ b/tests/data/utils/update_from_license_info_one_permissive_to_two_permissives_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_one_permissive_to_two_permissives_old.json b/tests/data/utils/update_from_license_info_one_permissive_to_two_permissives_old.json index 3a9f094d..44915f29 100644 --- a/tests/data/utils/update_from_license_info_one_permissive_to_two_permissives_old.json +++ b/tests/data/utils/update_from_license_info_one_permissive_to_two_permissives_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_permissive_license_info_added_new.json b/tests/data/utils/update_from_license_info_permissive_license_info_added_new.json index b44bcb47..9ac5f9db 100644 --- a/tests/data/utils/update_from_license_info_permissive_license_info_added_new.json +++ b/tests/data/utils/update_from_license_info_permissive_license_info_added_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_permissive_license_info_added_old.json b/tests/data/utils/update_from_license_info_permissive_license_info_added_old.json index c6f3890f..ffc86434 100644 --- a/tests/data/utils/update_from_license_info_permissive_license_info_added_old.json +++ b/tests/data/utils/update_from_license_info_permissive_license_info_added_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [] diff --git a/tests/data/utils/update_from_license_info_permissive_license_info_removed_new.json b/tests/data/utils/update_from_license_info_permissive_license_info_removed_new.json index a419ea18..4f34ea2f 100644 --- a/tests/data/utils/update_from_license_info_permissive_license_info_removed_new.json +++ b/tests/data/utils/update_from_license_info_permissive_license_info_removed_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [] diff --git a/tests/data/utils/update_from_license_info_permissive_license_info_removed_old.json b/tests/data/utils/update_from_license_info_permissive_license_info_removed_old.json index 3a9f094d..44915f29 100644 --- a/tests/data/utils/update_from_license_info_permissive_license_info_removed_old.json +++ b/tests/data/utils/update_from_license_info_permissive_license_info_removed_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_single_license_change_new.json b/tests/data/utils/update_from_license_info_single_license_change_new.json index dd1822af..d856cf26 100644 --- a/tests/data/utils/update_from_license_info_single_license_change_new.json +++ b/tests/data/utils/update_from_license_info_single_license_change_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_single_license_change_old.json b/tests/data/utils/update_from_license_info_single_license_change_old.json index 9afb0c51..b658d305 100644 --- a/tests/data/utils/update_from_license_info_single_license_change_old.json +++ b/tests/data/utils/update_from_license_info_single_license_change_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_two_permissives_to_one_permissive_new.json b/tests/data/utils/update_from_license_info_two_permissives_to_one_permissive_new.json index d41c1788..c475080d 100644 --- a/tests/data/utils/update_from_license_info_two_permissives_to_one_permissive_new.json +++ b/tests/data/utils/update_from_license_info_two_permissives_to_one_permissive_new.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a", "original_path": "", "licenses": [ diff --git a/tests/data/utils/update_from_license_info_two_permissives_to_one_permissive_old.json b/tests/data/utils/update_from_license_info_two_permissives_to_one_permissive_old.json index b2deb18b..379e6107 100644 --- a/tests/data/utils/update_from_license_info_two_permissives_to_one_permissive_old.json +++ b/tests/data/utils/update_from_license_info_two_permissives_to_one_permissive_old.json @@ -10,6 +10,7 @@ { "path":"test/path.txt", "name": "path.txt", + "type": "file", "sha1": "a_modified", "original_path": "", "licenses": [ diff --git a/tests/test_deltacode.py b/tests/test_deltacode.py index ae90aeb2..df8afe8e 100644 --- a/tests/test_deltacode.py +++ b/tests/test_deltacode.py @@ -93,12 +93,12 @@ def test_DeltaCode_align_scan_zlib_alignment_exception(self): for f in results.codebase1.walk(): assert f.__class__.__name__ == 'ScannedResource' - assert f.rid != None + assert f.path is not None assert not f.is_filtered - for f in results.codebase1.walk(): + for f in results.codebase2.walk(): assert f.__class__.__name__ == 'ScannedResource' - assert f.rid != None + assert f.path is not None assert not f.is_filtered @pytest.mark.xfail(reason='Tests no longer required having None paths')