Skip to content

Commit 2465a7b

Browse files
committed
Create a test for genattrib to read a zip file with a filter list.
See related ticket #218
1 parent a3126c4 commit 2465a7b

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

about_code_tool/tests/test_genattrib.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,21 @@ def test_genattrib_from_zipped_dir(self):
110110
for ex in expected:
111111
self.assertTrue(ex in result)
112112

113+
def test_genattrib_from_zipped_dir_with_filter_list(self):
114+
self.maxDiff = None
115+
about_dir = 'about_code_tool/tests/testdata/genattrib/test.zip'
116+
generated_attrib = get_temp_file('generated.html')
117+
filter_list = 'about_code_tool/tests/testdata/genattrib/filter_list.csv'
118+
args = [about_dir, generated_attrib, filter_list]
119+
options = None
120+
genattrib_command_tester(args, options)
121+
result = open(generated_attrib).read()
122+
expected = [
123+
'bootstrap 2.3.2',
124+
'Annotator 1.2.10',
125+
]
126+
for ex in expected:
127+
self.assertTrue(ex in result)
113128

114129
def genattrib_command_tester(args, options):
115130
parser = genattrib.get_parser()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
about_file,name,version,about_resource,spec_version,date,description,description_file,home_url,download_url,readme,readme_file,install,install_file,changelog,changelog_file,news,news_file,news_url,notes,notes_file,contact,owner,author,author_file,copyright,copyright_file,notice_file,notice_url,license_text_file,license_url,license_spdx,redistribute,attribute,track_changes,vcs_tool,vcs_repository,vcs_path,vcs_tag,vcs_branch,vcs_revision,checksum_sha1,checksum_md5,checksum_sha256,dje_component,dje_license_key,dje_organization,dje_license_name,dje_license,notice,license_text,warnings,errors
2+
/thirdparty/annotator.ABOUT,Annotator,1.2.10,annotator-full.1.2.10.zip,,,,,http://okfnlabs.org/projects/annotator/,https://github.com/openannotation/annotator/releases/download/v1.2.10/annotator-full.1.2.10.zip,,,,,,,,,,,,,Open Knowledge,,,,,,,annotator.LICENSE,https://okfn.org/ip-policy/,,,,,git,https://github.com/openannotation/annotator.git,,,,,,,,,,,,mit,,,,"Field: about_resource, Value: annotator-full.1.2.10.zip, Message: File does not exist."
3+
/thirdparty/bootstrap.ABOUT,bootstrap,2.3.2,bootstrap-2.3.2.zip,,,"Sleek, intuitive, and powerful front-end framework for faster and easier web development.",,http://twitter.github.com/bootstrap/,https://github.com/twbs/bootstrap/archive/v2.3.2.zip,,,,,,,,,,,,,"Twitter, Inc.",,,"Copyright 2012 Twitter, Inc.",,,,bootstrap.LICENSE,,,,,,git,https://github.com/twitter/bootstrap.git,,,/tree/v2.3.2,,,,,,,,,apache-2.0,,,,"Field: about_resource, Value: bootstrap-2.3.2.zip, Message: File does not exist."
288 KB
Binary file not shown.

0 commit comments

Comments
 (0)