From 2d74893dd27c02ed09fdf4136cd6fd148a90f6b2 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Sun, 17 Apr 2011 16:30:09 +0200 Subject: [PATCH] Add testcase for bug #701487. --- ubuntutools/test/test_update_maintainer.py | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/ubuntutools/test/test_update_maintainer.py b/ubuntutools/test/test_update_maintainer.py index 214a467..dc68144 100644 --- a/ubuntutools/test/test_update_maintainer.py +++ b/ubuntutools/test/test_update_maintainer.py @@ -150,6 +150,41 @@ endif ... 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 +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 +XSBC-Original-Maintainer: Emilio Pozuelo Monfort +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 class UpdateMaintainerTestCase(mox.MoxTestBase, unittest.TestCase): """TestCase object for ubuntutools.update_maintainer""" @@ -236,6 +271,15 @@ class UpdateMaintainerTestCase(mox.MoxTestBase, unittest.TestCase): update_maintainer(self._directory, True) 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): """Test: Skip update when XSBC-Original in debian/rules.""" self._files["changelog"] = StringIO.StringIO(_LUCID_CHANGELOG)