Beispiel #1
0
 def test_skip_smart_rules(self):
     """Test: Skip update when XSBC-Original in debian/rules."""
     self._files["changelog"] = StringIO(_LUCID_CHANGELOG)
     self._files["control"] = StringIO(_ABP_CONTROL)
     self._files["rules"] = StringIO(_COMPLEX_RULES)
     update_maintainer(self._directory)
     self.assertEqual(self._files["control"].getvalue(), _ABP_CONTROL)
Beispiel #2
0
 def test_missing_rules(self):
     """Test: Skip XSBC-Original test when debian/rules is missing."""
     self._files["changelog"] = StringIO(_LUCID_CHANGELOG)
     self._files["control"] = StringIO(_ABP_CONTROL)
     self._files["rules"] = None
     update_maintainer(self._directory)
     self.assertEqual(self._files["control"].getvalue(), _ABP_UPDATED)
def _update_maintainer_field():
    """Update the Maintainer field in debian/control."""
    Logger.command(["update-maintainer"])
    try:
        update_maintainer("debian", Logger.verbose)
    except MaintainerUpdateException as e:
        Logger.error("update-maintainer failed: %s", str(e))
        sys.exit(1)
Beispiel #4
0
 def test_comments_in_control(self):
     """Test: Update Maintainer field in a control file containing
        comments."""
     self._files["changelog"] = StringIO(_LUCID_CHANGELOG)
     self._files["control"] = StringIO(_SEAHORSE_PLUGINS_CONTROL)
     update_maintainer(self._directory)
     self.assertEqual(self._files["control"].getvalue(),
                      _SEAHORSE_PLUGINS_UPDATED)
Beispiel #5
0
    def test_original_ubuntu_maintainer(self):
        """Test: Original maintainer is Ubuntu developer.

           The Maintainer field needs to be update even if
           XSBC-Original-Maintainer has an @ubuntu.com address."""
        self._files["changelog"] = StringIO(_LUCID_CHANGELOG)
        self._files["control"] = StringIO(_AXIS2C_CONTROL)
        update_maintainer(self._directory)
        self.assertEqual(self._files["control"].getvalue(), _AXIS2C_UPDATED)
        warnings = Logger.stderr.getvalue().strip()
        Logger.stderr = StringIO()
        self.assertEqual(len(warnings.splitlines()), 1)
        self.assertRegex(
            warnings, "Warning: Overwriting original maintainer: "
            "Soren Hansen <*****@*****.**>")
Beispiel #6
0
 def test_update_old_maintainer(self):
     """Test: Update old MOTU address."""
     self._files["changelog"] = StringIO(_UNSTABLE_CHANGELOG)
     self._files["control.in"] = StringIO(_ABP_OLD_MAINTAINER)
     update_maintainer(self._directory, True)
     self.assertEqual(self._files["control.in"].getvalue(), _ABP_UPDATED)
Beispiel #7
0
 def test_update_maintainer(self):
     """Test: Update Maintainer field."""
     self._files["changelog"] = StringIO(_LUCID_CHANGELOG)
     self._files["control"] = StringIO(_ABP_CONTROL)
     update_maintainer(self._directory)
     self.assertEqual(self._files["control"].getvalue(), _ABP_UPDATED)
Beispiel #8
0
 def test_debian_package(self):
     """Test: Don't update Maintainer field if target is Debian."""
     self._files["changelog"] = StringIO(_UNSTABLE_CHANGELOG)
     self._files["control"] = StringIO(_ABP_CONTROL)
     update_maintainer(self._directory)
     self.assertEqual(self._files["control"].getvalue(), _ABP_CONTROL)