diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-10-20 23:06:33 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-10-20 23:06:33 -0700 |
commit | 1e1413717df6ed6809833004bf47088e021ccb46 (patch) | |
tree | 338fe0a2bd4a3b21e5bcc2f27d6317d3137da569 /pym/portage/tests/repoman | |
parent | 7d7fa4af2dbec7e7cc06e5ac176fe0b697ee867b (diff) | |
download | portage-1e1413717df6ed6809833004bf47088e021ccb46.tar.gz portage-1e1413717df6ed6809833004bf47088e021ccb46.tar.bz2 portage-1e1413717df6ed6809833004bf47088e021ccb46.zip |
UpdateChangeLog: split out/test copyright regex
This also fixes a case where something like "Copyright 2011 " would be
replaced with "Copyright 2011-2011 ".
Diffstat (limited to 'pym/portage/tests/repoman')
-rw-r--r-- | pym/portage/tests/repoman/test_simple.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/pym/portage/tests/repoman/test_simple.py b/pym/portage/tests/repoman/test_simple.py index 83de883e1..9dae0efda 100644 --- a/pym/portage/tests/repoman/test_simple.py +++ b/pym/portage/tests/repoman/test_simple.py @@ -14,9 +14,32 @@ from portage.process import find_binary from portage.tests import TestCase from portage.tests.resolver.ResolverPlayground import ResolverPlayground from portage.util import ensure_dirs +from repoman.utilities import _update_copyright_year class SimpleRepomanTestCase(TestCase): + def testCopyrightUpdate(self): + test_cases = ( + ( + '2011', + '# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2', + '# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2', + ), + ( + '2011', + '# Copyright 1999 Gentoo Foundation; Distributed under the GPL v2', + '# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2', + ), + ( + '1999', + '# Copyright 1999 Gentoo Foundation; Distributed under the GPL v2', + '# Copyright 1999 Gentoo Foundation; Distributed under the GPL v2', + ), + ) + + for year, before, after in test_cases: + self.assertEqual(_update_copyright_year(year, before), after) + def _must_skip(self): xmllint = find_binary("xmllint") if not xmllint: |