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
1=== modified file 'license_protected_downloads/tests/test_buildinfo.py'
2--- license_protected_downloads/tests/test_buildinfo.py 2013-01-30 10:46:11 +0000
3+++ license_protected_downloads/tests/test_buildinfo.py 2013-02-20 13:12:30 +0000
4@@ -14,15 +14,26 @@
5 self.buildinfo_file_path = os.path.join(THIS_DIRECTORY,
6 "BUILD-INFO.txt")
7
8- def test_readFile_nonFile(self):
9+ def test_no_buildinfo(self):
10+ file_path = THIS_DIRECTORY + \
11+ '/testserver_root/build-info/no-build-info/file'
12 with self.assertRaises(IOError):
13- BuildInfo("license_protected_downloads")
14-
15- def test_readFile_nonexistentFile(self):
16+ BuildInfo(file_path)
17+
18+ def test_apply_to_dir(self):
19+ dir_path = THIS_DIRECTORY + \
20+ '/testserver_root/build-info/subdir'
21+ build_info = BuildInfo(dir_path)
22+ self.assertEquals(build_info.getInfoForFile(),
23+ [{'build-name': 'landing-protected',
24+ 'license-type': 'protected',
25+ 'openid-launchpad-teams': 'linaro'}])
26+
27+ def test_apply_to_nonexistent_file(self):
28 with self.assertRaises(IOError):
29 BuildInfo("nonexistent.file")
30
31- def test_readFile_File(self):
32+ def test_apply_to_file(self):
33 build_info = BuildInfo(self.buildinfo_file_path)
34
35 self.assertIn("Files-Pattern: *.txt", build_info.lines)
36
37=== added directory 'license_protected_downloads/tests/testserver_root/build-info/no-build-info'
38=== added file 'license_protected_downloads/tests/testserver_root/build-info/no-build-info/file'
39--- license_protected_downloads/tests/testserver_root/build-info/no-build-info/file 1970-01-01 00:00:00 +0000
40+++ license_protected_downloads/tests/testserver_root/build-info/no-build-info/file 2013-02-20 13:12:30 +0000
41@@ -0,0 +1,1 @@
42+just file

Subscribers

People subscribed via source and target branches