~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

Merge from bzr.ab.integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# little as possible, so this should be used rarely if it's added at all.
22
22
# (Suggestion from j-a-meinel, 2005-11-24)
23
23
 
 
24
# NOTE: Some classes in here use camelCaseNaming() rather than
 
25
# underscore_naming().  That's for consistency with unittest; it's not the
 
26
# general style of bzrlib.  Please continue that consistency when adding e.g.
 
27
# new assertFoo() methods.
 
28
 
24
29
import codecs
25
30
from cStringIO import StringIO
26
31
import difflib
84
89
    import bzrlib.tests.branch_implementations
85
90
    import bzrlib.tests.bzrdir_implementations
86
91
    import bzrlib.tests.interrepository_implementations
 
92
    import bzrlib.tests.interversionedfile_implementations
87
93
    import bzrlib.tests.repository_implementations
 
94
    import bzrlib.tests.revisionstore_implementations
88
95
    import bzrlib.tests.workingtree_implementations
89
96
    return [
90
97
            bzrlib.doc,
92
99
            bzrlib.tests.branch_implementations,
93
100
            bzrlib.tests.bzrdir_implementations,
94
101
            bzrlib.tests.interrepository_implementations,
 
102
            bzrlib.tests.interversionedfile_implementations,
95
103
            bzrlib.tests.repository_implementations,
 
104
            bzrlib.tests.revisionstore_implementations,
96
105
            bzrlib.tests.workingtree_implementations,
97
106
            ]
98
107
 
791
800
            # TODO: rbc 20060208
792
801
            return WorkingTreeFormat2().initialize(bzrdir.BzrDir.open(relpath))
793
802
 
 
803
    def assertIsDirectory(self, relpath, transport):
 
804
        """Assert that relpath within transport is a directory.
 
805
 
 
806
        This may not be possible on all transports; in that case it propagates
 
807
        a TransportNotPossible.
 
808
        """
 
809
        try:
 
810
            mode = transport.stat(relpath).st_mode
 
811
        except errors.NoSuchFile:
 
812
            self.fail("path %s is not a directory; no such file"
 
813
                      % (relpath))
 
814
        if not stat.S_ISDIR(mode):
 
815
            self.fail("path %s is not a directory; has mode %#o"
 
816
                      % (relpath, mode))
 
817
 
794
818
 
795
819
class ChrootedTestCase(TestCaseWithTransport):
796
820
    """A support class that provides readonly urls outside the local namespace.
894
918
                   'bzrlib.tests.test_http',
895
919
                   'bzrlib.tests.test_identitymap',
896
920
                   'bzrlib.tests.test_inv',
 
921
                   'bzrlib.tests.test_knit',
897
922
                   'bzrlib.tests.test_lockdir',
898
923
                   'bzrlib.tests.test_lockable_files',
899
924
                   'bzrlib.tests.test_log',
907
932
                   'bzrlib.tests.test_osutils',
908
933
                   'bzrlib.tests.test_permissions',
909
934
                   'bzrlib.tests.test_plugins',
 
935
                   'bzrlib.tests.test_reconcile',
910
936
                   'bzrlib.tests.test_repository',
911
937
                   'bzrlib.tests.test_revision',
912
938
                   'bzrlib.tests.test_revisionnamespaces',
913
939
                   'bzrlib.tests.test_revprops',
914
 
                   'bzrlib.tests.test_reweave',
915
940
                   'bzrlib.tests.test_rio',
916
941
                   'bzrlib.tests.test_sampler',
917
942
                   'bzrlib.tests.test_selftest',
930
955
                   'bzrlib.tests.test_ui',
931
956
                   'bzrlib.tests.test_uncommit',
932
957
                   'bzrlib.tests.test_upgrade',
 
958
                   'bzrlib.tests.test_versionedfile',
933
959
                   'bzrlib.tests.test_weave',
934
960
                   'bzrlib.tests.test_whitebox',
935
961
                   'bzrlib.tests.test_workingtree',