/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import os.path
23
23
from StringIO import StringIO
 
24
import subprocess
 
25
import sys
24
26
 
25
27
from bzrlib import (
26
28
    bzrdir,
29
31
    repository,
30
32
    symbol_versioning,
31
33
    urlutils,
 
34
    win32utils,
32
35
    workingtree,
33
36
    )
34
37
import bzrlib.branch
42
45
from bzrlib.tests import (
43
46
    TestCase,
44
47
    TestCaseWithTransport,
 
48
    TestSkipped,
45
49
    test_sftp_transport
46
50
    )
47
51
from bzrlib.tests.HttpServer import HttpServer
870
874
    """Tests redirections for pycurl implementation"""
871
875
 
872
876
    _qualifier = 'pycurl'
 
877
 
 
878
 
 
879
class TestDotBzrHidden(TestCaseWithTransport):
 
880
 
 
881
    ls = ['ls']
 
882
    if sys.platform == 'win32':
 
883
        ls = [os.environ['COMSPEC'], '/C', 'dir', '/B']
 
884
 
 
885
    def get_ls(self):
 
886
        f = subprocess.Popen(self.ls, stdout=subprocess.PIPE,
 
887
            stderr=subprocess.PIPE)
 
888
        out, err = f.communicate()
 
889
        self.assertEqual(0, f.returncode, 'Calling %s failed: %s'
 
890
                         % (self.ls, err))
 
891
        return out.splitlines()
 
892
 
 
893
    def test_dot_bzr_hidden(self):
 
894
        if sys.platform == 'win32' and not win32utils.has_win32file:
 
895
            raise TestSkipped('unable to make file hidden without pywin32 library')
 
896
        b = bzrdir.BzrDir.create('.')
 
897
        self.build_tree(['a'])
 
898
        self.assertEquals(['a'], self.get_ls())
 
899
 
 
900
    def test_dot_bzr_hidden_with_url(self):
 
901
        if sys.platform == 'win32' and not win32utils.has_win32file:
 
902
            raise TestSkipped('unable to make file hidden without pywin32 library')
 
903
        b = bzrdir.BzrDir.create(urlutils.local_path_to_url('.'))
 
904
        self.build_tree(['a'])
 
905
        self.assertEquals(['a'], self.get_ls())