Skip to content

Commit 6377465

Browse files
committed
Add test code for generate attribtuion function
1 parent 36e20fc commit 6377465

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

about_code_tool/tests/test_about.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,15 @@ def test_generate_attribution_with_default_template(self):
654654
# Strip all the white spaces
655655
self.assertEqual(re.sub(r'\s+', '', expected), re.sub(r'\s+', '', result))
656656

657+
def test_generate_attribution_with_limit_to(self):
658+
f = open(join(TESTDATA_DIR, 'attrib/attrib.html'))
659+
expected = f.read()
660+
test_file = join(TESTDATA_DIR, 'attrib/')
661+
collector = about.Collector(test_file)
662+
result = collector.generate_attribution(limit_to=['/attrib.ABOUT'])
663+
# Strip all the white spaces
664+
self.assertEqual(re.sub(r'\s+', '', expected), re.sub(r'\s+', '', result))
665+
657666
def test_generate_attribution_verification(self):
658667
expected = (u'name,version,copyright,dje_license_name\n'
659668
'Apache HTTP Server,2.4.3,,')

0 commit comments

Comments
 (0)