Add testcase for bug #701487.

This commit is contained in:
Benjamin Drung 2011-04-17 16:30:09 +02:00
parent 457a6c6bee
commit 2d74893dd2

View File

@ -150,6 +150,41 @@ endif
... from python2.6 ... ... from python2.6 ...
""" """
_SEAHORSE_PLUGINS_CONTROL = """# This file is autogenerated. DO NOT EDIT!
#
# Modifications should be made to debian/control.in instead.
# This file is regenerated automatically in the clean target.
Source: seahorse-plugins
Section: gnome
Priority: optional
Maintainer: Emilio Pozuelo Monfort <pochu@debian.org>
Build-Depends: debhelper (>= 5),
cdbs (>= 0.4.41)
Standards-Version: 3.8.3
Homepage: http://live.gnome.org/Seahorse
Package: seahorse-plugins
"""
_SEAHORSE_PLUGINS_UPDATED = """# This file is autogenerated. DO NOT EDIT!
#
# Modifications should be made to debian/control.in instead.
# This file is regenerated automatically in the clean target.
Source: seahorse-plugins
Section: gnome
Priority: optional
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
XSBC-Original-Maintainer: Emilio Pozuelo Monfort <pochu@debian.org>
Build-Depends: debhelper (>= 5),
cdbs (>= 0.4.41)
Standards-Version: 3.8.3
Homepage: http://live.gnome.org/Seahorse
Package: seahorse-plugins
"""
#pylint: disable=R0904 #pylint: disable=R0904
class UpdateMaintainerTestCase(mox.MoxTestBase, unittest.TestCase): class UpdateMaintainerTestCase(mox.MoxTestBase, unittest.TestCase):
"""TestCase object for ubuntutools.update_maintainer""" """TestCase object for ubuntutools.update_maintainer"""
@ -236,6 +271,15 @@ class UpdateMaintainerTestCase(mox.MoxTestBase, unittest.TestCase):
update_maintainer(self._directory, True) update_maintainer(self._directory, True)
self.assertEqual(self._files["control.in"].getvalue(), _ABP_UPDATED) self.assertEqual(self._files["control.in"].getvalue(), _ABP_UPDATED)
def test_comments_in_control(self):
"""Test: Update Maintainer field in a control file containing
comments."""
self._files["changelog"] = StringIO.StringIO(_LUCID_CHANGELOG)
self._files["control"] = StringIO.StringIO(_SEAHORSE_PLUGINS_CONTROL)
update_maintainer(self._directory)
self.assertEqual(self._files["control"].getvalue(),
_SEAHORSE_PLUGINS_UPDATED)
def test_skip_smart_rules(self): def test_skip_smart_rules(self):
"""Test: Skip update when XSBC-Original in debian/rules.""" """Test: Skip update when XSBC-Original in debian/rules."""
self._files["changelog"] = StringIO.StringIO(_LUCID_CHANGELOG) self._files["changelog"] = StringIO.StringIO(_LUCID_CHANGELOG)