~ubuntu-branches/debian/sid/bzr-svn/sid

« back to all changes in this revision

Viewing changes to tests/test_layout.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-06-03 16:30:56 UTC
  • mfrom: (1.3.1 upstream) (3.1.8 karmic)
  • Revision ID: james.westby@ubuntu.com-20090603163056-296clrwflq0oqzwb
Tags: 0.6.2-1
* New upstream snapshot.
* Allow python-sqlite to not be installed if python-tdb is installed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
 
from bzrlib.tests import TestCase
 
16
from bzrlib.tests import (
 
17
    TestCase,
 
18
    )
17
19
 
18
 
from bzrlib.plugins.svn.errors import NotSvnBranchPath
 
20
from bzrlib.plugins.svn.errors import (
 
21
    NotSvnBranchPath,
 
22
    )
19
23
from bzrlib.plugins.svn.layout.standard import (
 
24
    CustomLayout,
20
25
    RootLayout,
21
26
    TrunkLayout,
22
27
    WildcardLayout,
41
46
class RootLayoutTests(TestCase,LayoutTests):
42
47
 
43
48
    def setUp(self):
 
49
        TestCase.setUp(self)
44
50
        self.layout = RootLayout()
45
51
 
46
52
 
47
53
class TrunkLayoutTests(TestCase,LayoutTests):
48
54
 
49
55
    def setUp(self):
 
56
        TestCase.setUp(self)
50
57
        self.layout = TrunkLayout()
51
58
 
52
59
    def test_is_branch_parent(self):
82
89
class Trunk2LayoutTests(TestCase):
83
90
 
84
91
    def setUp(self):
 
92
        TestCase.setUp(self)
85
93
        self.layout = TrunkLayout(2)
86
94
 
87
95
    def test_is_branch_parent_trunk(self):
124
132
        self.assertEquals("bla", x.get_tag_name("tags/bla"))
125
133
        x = WildcardLayout(["trunk"], ["tags/bla"])
126
134
        self.assertEquals(None, x.get_tag_name("bla"))
 
135
 
 
136
 
 
137
class CustomLayoutTests(TestCase):
 
138
 
 
139
    def test_is_branch(self):
 
140
        x = CustomLayout(["foo/bar"])
 
141
        self.assertTrue(x.is_branch("foo/bar"))
 
142
        self.assertFalse(x.is_branch("foo"))
 
143
 
 
144
    def test_is_branch_parent(self):
 
145
        x = CustomLayout(["foo/bar"])
 
146
        self.assertFalse(x.is_branch_parent("foo/bar"))
 
147
        self.assertTrue(x.is_branch_parent("foo"))