Skip to content

Commit 1e29ee7

Browse files
committed
Create test code.
1 parent 5e3ba53 commit 1e29ee7

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

about_code_tool/tests/test_about.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,3 +687,12 @@ def test_get_custom_field_keys(self):
687687
'organization']
688688
self.assertEqual(result, expected)
689689

690+
def test_get_about_name(self):
691+
about_file = about.AboutFile(join(TESTDATA_DIR, 'basic/simple.about'))
692+
result = about_file.get_about_name()
693+
self.assertEqual(result, 'simple')
694+
695+
def test_get_dje_license_name(self):
696+
about_file = about.AboutFile(join(TESTDATA_DIR, 'basic/simple.about'))
697+
result = about_file.get_dje_license_name()
698+
self.assertEqual(result, 'Apache License 2.0')

about_code_tool/tests/test_genattrib.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,10 @@ def test_update_path_to_about(self):
6262
'test/test3.c.ABOUT']
6363
result = genattrib.update_path_to_about(test)
6464
self.assertEqual(expected, result)
65+
66+
def test_component_subset_to_sublist(self):
67+
test = [{'about_file': '/tmp/', 'notes': 'test'},
68+
{'about_file': '/tmp/t1/', 'dje_license': 'bsd-new'}]
69+
expected = ['/tmp/', '/tmp/t1/']
70+
result = genattrib.component_subset_to_sublist(test)
71+
self.assertEqual(expected, result)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
about_resource: .
2+
name: simple
3+
version: 2.2
4+
5+
dje_license: apache-2.0
6+
dje_license_name: Apache License 2.0

0 commit comments

Comments
 (0)