Skip to content

Commit

Permalink
Create test code.
Browse files Browse the repository at this point in the history
  • Loading branch information
chinyeungli committed Oct 29, 2014
1 parent 5e3ba53 commit 1e29ee7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions about_code_tool/tests/test_about.py
Expand Up @@ -687,3 +687,12 @@ def test_get_custom_field_keys(self):
'organization']
self.assertEqual(result, expected)

def test_get_about_name(self):
about_file = about.AboutFile(join(TESTDATA_DIR, 'basic/simple.about'))
result = about_file.get_about_name()
self.assertEqual(result, 'simple')

def test_get_dje_license_name(self):
about_file = about.AboutFile(join(TESTDATA_DIR, 'basic/simple.about'))
result = about_file.get_dje_license_name()
self.assertEqual(result, 'Apache License 2.0')
7 changes: 7 additions & 0 deletions about_code_tool/tests/test_genattrib.py
Expand Up @@ -62,3 +62,10 @@ def test_update_path_to_about(self):
'test/test3.c.ABOUT']
result = genattrib.update_path_to_about(test)
self.assertEqual(expected, result)

def test_component_subset_to_sublist(self):
test = [{'about_file': '/tmp/', 'notes': 'test'},
{'about_file': '/tmp/t1/', 'dje_license': 'bsd-new'}]
expected = ['/tmp/', '/tmp/t1/']
result = genattrib.component_subset_to_sublist(test)
self.assertEqual(expected, result)
6 changes: 6 additions & 0 deletions about_code_tool/tests/testdata/basic/simple.about
@@ -0,0 +1,6 @@
about_resource: .
name: simple
version: 2.2

dje_license: apache-2.0
dje_license_name: Apache License 2.0

0 comments on commit 1e29ee7

Please sign in to comment.