~bzr/ubuntu/maverick/bzr-svn/bzr-ppa

« back to all changes in this revision

Viewing changes to tests/test_workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2008-05-11 19:29:26 UTC
  • mfrom: (220.36.144 0.4)
  • Revision ID: jelmer@samba.org-20080511192926-7mh02j45r25qmzkz
Merge 0.4 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
# This program is free software; you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License as published by
6
 
# the Free Software Foundation; either version 2 of the License, or
 
6
# the Free Software Foundation; either version 3 of the License, or
7
7
# (at your option) any later version.
8
8
 
9
9
# This program is distributed in the hope that it will be useful,
21
21
from bzrlib.errors import NoSuchFile, OutOfDateTree
22
22
from bzrlib.inventory import Inventory
23
23
from bzrlib.osutils import has_symlinks, supports_executable
24
 
from bzrlib.tests import KnownFailure
 
24
from bzrlib.tests import KnownFailure, TestCase
25
25
from bzrlib.trace import mutter
26
26
from bzrlib.workingtree import WorkingTree
27
27
 
32
32
 
33
33
from transport import svn_config
34
34
from tests import TestCaseWithSubversionRepository
 
35
from workingtree import generate_ignore_list
35
36
 
36
37
class TestWorkingTree(TestCaseWithSubversionRepository):
37
38
    def test_add_duplicate(self):
646
647
        tree = self.open_checkout("de")
647
648
        self.build_tree({'de/some strange file': 'data-y'})
648
649
        self.assertRaises(OutOfDateTree, lambda: tree.commit("bar"))
 
650
 
 
651
 
 
652
class IgnoreListTests(TestCase):
 
653
    def test_empty(self):
 
654
        self.assertEquals([], generate_ignore_list({}))
 
655
 
 
656
    def test_simple(self):
 
657
        self.assertEquals(["./twin/peaks"], 
 
658
                generate_ignore_list({"twin": "peaks"}))
 
659
 
 
660
    def test_toplevel(self):
 
661
        self.assertEquals(["./twin*"], 
 
662
                generate_ignore_list({"": "twin*"}))
 
663
 
 
664
    def test_multiple(self):
 
665
        self.assertEquals(["./twin*", "./twin/peaks"], 
 
666
                generate_ignore_list({"twin": "peaks", "": "twin*"}))
 
667
 
 
668