Merge lp:~pfalcon/linaro-license-protection/revamp-buildinfo-tests into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Paul Sokolovsky
Status: Merged
Approved by: Данило Шеган
Approved revision: 163
Merged at revision: 163
Proposed branch: lp:~pfalcon/linaro-license-protection/revamp-buildinfo-tests
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 42 lines (+17/-5)
2 files modified
license_protected_downloads/tests/test_buildinfo.py (+16/-5)
license_protected_downloads/tests/testserver_root/build-info/no-build-info/file (+1/-0)
To merge this branch: bzr merge lp:~pfalcon/linaro-license-protection/revamp-buildinfo-tests
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Review via email: mp+149556@code.launchpad.net

This proposal supersedes a proposal from 2013-02-20.

Description of the change

Revamp failure in linaro-license-protection's testsuite. Individual commits has detailed description of changes and reasons behind them.

Resubmitted with additional changes to address confusion with test_apply_to_dir().

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote : Posted in a previous version of this proposal

This looks good.

review: Approve
Revision history for this message
Данило Шеган (danilo) : Posted in a previous version of this proposal
review: Needs Fixing
Revision history for this message
Данило Шеган (danilo) wrote :

This is now good and the tests pass for me as well.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'license_protected_downloads/tests/test_buildinfo.py'
--- license_protected_downloads/tests/test_buildinfo.py 2013-01-30 10:46:11 +0000
+++ license_protected_downloads/tests/test_buildinfo.py 2013-02-20 13:12:30 +0000
@@ -14,15 +14,26 @@
14 self.buildinfo_file_path = os.path.join(THIS_DIRECTORY,14 self.buildinfo_file_path = os.path.join(THIS_DIRECTORY,
15 "BUILD-INFO.txt")15 "BUILD-INFO.txt")
1616
17 def test_readFile_nonFile(self):17 def test_no_buildinfo(self):
18 file_path = THIS_DIRECTORY + \
19 '/testserver_root/build-info/no-build-info/file'
18 with self.assertRaises(IOError):20 with self.assertRaises(IOError):
19 BuildInfo("license_protected_downloads")21 BuildInfo(file_path)
2022
21 def test_readFile_nonexistentFile(self):23 def test_apply_to_dir(self):
24 dir_path = THIS_DIRECTORY + \
25 '/testserver_root/build-info/subdir'
26 build_info = BuildInfo(dir_path)
27 self.assertEquals(build_info.getInfoForFile(),
28 [{'build-name': 'landing-protected',
29 'license-type': 'protected',
30 'openid-launchpad-teams': 'linaro'}])
31
32 def test_apply_to_nonexistent_file(self):
22 with self.assertRaises(IOError):33 with self.assertRaises(IOError):
23 BuildInfo("nonexistent.file")34 BuildInfo("nonexistent.file")
2435
25 def test_readFile_File(self):36 def test_apply_to_file(self):
26 build_info = BuildInfo(self.buildinfo_file_path)37 build_info = BuildInfo(self.buildinfo_file_path)
2738
28 self.assertIn("Files-Pattern: *.txt", build_info.lines)39 self.assertIn("Files-Pattern: *.txt", build_info.lines)
2940
=== added directory 'license_protected_downloads/tests/testserver_root/build-info/no-build-info'
=== added file 'license_protected_downloads/tests/testserver_root/build-info/no-build-info/file'
--- license_protected_downloads/tests/testserver_root/build-info/no-build-info/file 1970-01-01 00:00:00 +0000
+++ license_protected_downloads/tests/testserver_root/build-info/no-build-info/file 2013-02-20 13:12:30 +0000
@@ -0,0 +1,1 @@
1just file

Subscribers

People subscribed via source and target branches