Merge lp://staging/~brian-murray/apport/bug-1336062 into lp://staging/~apport-hackers/apport/trunk

Proposed by Brian Murray
Status: Merged
Merged at revision: 2818
Proposed branch: lp://staging/~brian-murray/apport/bug-1336062
Merge into: lp://staging/~apport-hackers/apport/trunk
Diff against target: 90 lines (+31/-29)
2 files modified
backends/packaging-apt-dpkg.py (+29/-29)
test/test_backend_apt_dpkg.py (+2/-0)
To merge this branch: bzr merge lp://staging/~brian-murray/apport/bug-1336062
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+226380@code.staging.launchpad.net

Description of the change

This is pretty well documented in the attached bug report. I've chosen to test this by pretending that '/bin/true' is provided by mypackage. If we are using the cache from the sandbox then the test will pass, if not the test will fail with the following message.

 $ PYTHON=python3 test/run backend_apt_dpkg.test_get_file_package_uninstalled
Testing local source tree.
Running pep8...
Running pyflakes...
--- Testing backend_apt_dpkg.test_get_file_package_uninstalled ---
test_get_file_package_uninstalled (__main__.T)
get_file_package() on uninstalled packages. ... FAIL

======================================================================
FAIL: test_get_file_package_uninstalled (__main__.T)
get_file_package() on uninstalled packages.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_backend_apt_dpkg.py", line 230, in test_get_file_package_uninstalled
    self.assertEqual(impl.get_file_package('/bin/true', True, cache_dir), 'mypackage')
AssertionError: 'coreutils' != 'mypackage'
- coreutils
+ mypackage

----------------------------------------------------------------------
Ran 1 test in 4.107s

FAILED (failures=1)

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks Brian, nice catch! I un-indented the moved code block again (as "return" doesn't need an else branch) to make the diff easier to read.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches