~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport_implementations.py

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006 by Canonical Ltd
 
1
# Copyright (C) 2004, 2005, 2006 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
962
962
            l.sort()
963
963
            return l
964
964
 
965
 
        # SftpServer creates control files in the working directory
966
 
        # so lets move down a directory to avoid those.
967
 
        if not t.is_readonly():
968
 
            t.mkdir('wd')
969
 
        else:
970
 
            os.mkdir('wd')
971
 
        t = t.clone('wd')
972
 
 
973
965
        self.assertEqual([], sorted_list('.'))
974
966
        # c2 is precisely one letter longer than c here to test that
975
967
        # suffixing is not confused.
976
968
        # a%25b checks that quoting is done consistently across transports
977
969
        tree_names = ['a', 'a%25b', 'b', 'c/', 'c/d', 'c/e', 'c2/']
 
970
 
978
971
        if not t.is_readonly():
979
972
            self.build_tree(tree_names, transport=t)
980
973
        else:
981
 
            self.build_tree(['wd/' + name for name in tree_names])
 
974
            self.build_tree(tree_names)
982
975
 
983
976
        self.assertEqual(
984
977
            ['a', 'a%2525b', 'b', 'c', 'c2'], sorted_list('.'))
988
981
            t.delete('c/d')
989
982
            t.delete('b')
990
983
        else:
991
 
            os.unlink('wd/c/d')
992
 
            os.unlink('wd/b')
 
984
            os.unlink('c/d')
 
985
            os.unlink('b')
993
986
            
994
987
        self.assertEqual(['a', 'a%2525b', 'c', 'c2'], sorted_list('.'))
995
988
        self.assertEqual(['e'], sorted_list('c'))