[Reportbug-commits] [reportbug] 02/03: Improve test_bts791577

Sandro Tosi morph at moszumanska.debian.org
Thu Sep 3 19:49:25 UTC 2015


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository reportbug.

commit 16bddc75b1aa08f0f4671fee64e766020b3a0083
Author: Sandro Tosi <morph at debian.org>
Date:   Mon Aug 31 16:06:04 2015 +0100

    Improve test_bts791577
    
    * just use a comment not a docstring at the beginning
    * assert at the end, so if it fails, the method is still restored (we need a
      context manager!)
    * use a fake package name, to avoid the cache
---
 test/test_utils.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/test_utils.py b/test/test_utils.py
index d10cbe2..f9d8b57 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -149,7 +149,7 @@ class TestPackages(unittest2.TestCase):
         self.assertIsNotNone(recommends)
 
     def test_bts791577(self):
-        """Verify obsolete config files are correctly parsed"""
+        # Verify obsolete config files are correctly parsed
 
         # bonus points for testing also conffiles with spaces in the filename
         pkgstatus = """Conffiles:
@@ -159,7 +159,7 @@ class TestPackages(unittest2.TestCase):
  /etc/reportbug with spaces and obsolete.conf cafebabecafebabecafebabecafebabe obsolete
         """
 
-        pkg = 'reportbug'
+        pkg = 'test_bts791577'
 
         expected_conffiles = [u'/etc/reportbug.conf',
                               u'/etc/reportbug with spaces.conf',
@@ -170,9 +170,9 @@ class TestPackages(unittest2.TestCase):
         commands.getoutput = mock.MagicMock(return_value=pkgstatus)
         result = utils.get_package_status(pkg)
         conffile = [x[0] for x in result[4]]
-        self.assertListEqual(conffile, expected_conffiles)
         commands.getoutput = __save
         del __save
+        self.assertListEqual(conffile, expected_conffiles)
 
     def test_get_changed_config_files(self):
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reportbug/reportbug.git



More information about the Reportbug-commits mailing list