/breezy-svn/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy-svn/trunk

« back to all changes in this revision

Viewing changes to tests/test_workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2008-03-27 01:13:59 UTC
  • mfrom: (525.1.3 ignore)
  • Revision ID: jelmer@samba.org-20080327011359-sj61cudcg73hve71
Merge utility code for ignores.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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