Esempio n. 1
0
	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)
Esempio n. 2
0
    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)