1
# Copyright (C) 2010 Canonical Limited
4
# This file is part of bzr-builddeb.
6
# bzr-builddeb is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
11
# bzr-builddeb is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with bzr-builddeb; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
"""Tests for bzrlib.plugins.builddeb.tagging."""
22
from bzrlib.plugins.builddeb import tagging
23
from bzrlib.tests import (
28
class TestIsUpstreamTag(TestCase):
30
def test_plain_version(self):
31
self.assertFalse(tagging.is_upstream_tag('2.1'))
33
def test_simple_upstream(self):
34
self.assertTrue(tagging.is_upstream_tag('upstream-2.1'))
36
def test_distro_upstream(self):
37
self.assertTrue(tagging.is_upstream_tag('upstream-debian-2.1'))
39
def test_git_upstream(self):
40
self.assertTrue(tagging.is_upstream_tag('upstream/2.1'))
43
class TestUpstreamTagVersion(TestCase):
45
def test_simple_upstream(self):
46
self.assertEqual('2.1', tagging.upstream_tag_version('upstream-2.1'))
48
def test_distro_upstream(self):
49
self.assertEqual('2.1',
50
tagging.upstream_tag_version('upstream-debian-2.1'))
52
def test_git_upstream(self):
53
self.assertEqual('2.1', tagging.upstream_tag_version('upstream/2.1'))