diff options
author | Paul Sokolovsky <paul.sokolovsky@linaro.org> | 2012-06-28 15:51:25 +0300 |
---|---|---|
committer | Paul Sokolovsky <paul.sokolovsky@linaro.org> | 2012-06-28 15:51:25 +0300 |
commit | c7533ed50f860a75edf050860cf6da2755708043 (patch) | |
tree | 5e7862a4acbd988c694c70e5ab3a4b04a7eb803a /license_protected_downloads/tests/test_buildinfo.py | |
parent | a92eb9cd89c2b622a0846a842bb3be36c3a75a7a (diff) | |
parent | 0f15e7368c6ea83a0f9152e97ad732fb3bb4e69d (diff) |
[merge] Merge upstream branch.
Diffstat (limited to 'license_protected_downloads/tests/test_buildinfo.py')
-rw-r--r-- | license_protected_downloads/tests/test_buildinfo.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/license_protected_downloads/tests/test_buildinfo.py b/license_protected_downloads/tests/test_buildinfo.py index abab3c4..e86bfbb 100644 --- a/license_protected_downloads/tests/test_buildinfo.py +++ b/license_protected_downloads/tests/test_buildinfo.py @@ -178,6 +178,32 @@ class BuildInfoTests(unittest.TestCase): for field in build_info.fields_defined: self.assertTrue(build_info.isValidField(field)) + def test_remove_false_positives_real(self): + build_info = BuildInfo(self.buildinfo_file_path) + build_info.build_info_array = [{}] + build_info.file_info_array = [{}] + data = ["Format-Version: 2.0", "Files-Pattern: *.txt", "License-Type: protected", + "Files-Pattern: *.txt", "License-Type: open"] + build_info.parseData(data) + build_info.file_info_array = build_info.getInfoForFile() + build_info.remove_false_positives() + + self.assertEquals(build_info.file_info_array, + [{'license-type': 'protected'}]) + + def test_remove_false_none(self): + build_info = BuildInfo(self.buildinfo_file_path) + build_info.build_info_array = [{}] + build_info.file_info_array = [{}] + data = ["Format-Version: 2.0", "Files-Pattern: *.txt", "License-Type: protected", + "Files-Pattern: *.txt", "License-Type: protected"] + build_info.parseData(data) + build_info.file_info_array = build_info.getInfoForFile() + build_info.remove_false_positives() + + self.assertEquals(build_info.file_info_array, + [{'license-type': 'protected'}, {'license-type': 'protected'}]) + def test_get_search_path(self): dir_path = THIS_DIRECTORY + '/testserver_root/build-info/subdir' |