~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

transport implementations now tested consistently.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
                                           HttpServer
76
76
                                           )
77
77
        from bzrlib.transport.ftp import FtpTransport
 
78
        from bzrlib.transport.memory import (MemoryTransport,
 
79
                                             MemoryServer
 
80
                                             )
78
81
        from bzrlib.transport import TransportTestProviderAdapter
79
82
        # FIXME. What we want is a factory for the things
80
83
        # needed to test the implementation. I.e. for transport we want:
101
104
        sftp_abs_test = test_iter.next()
102
105
        sftp_homedir_test = test_iter.next()
103
106
        http_test = test_iter.next()
 
107
        memory_test = test_iter.next()
104
108
        # ftp_test = test_iter.next()
105
109
        self.assertRaises(StopIteration, test_iter.next)
106
110
        self.assertEqual(LocalTransport, local_relpath_test.transport_class)
116
120
        self.assertEqual(SFTPAbsoluteServer, sftp_abs_test.transport_server)
117
121
        self.assertEqual(SFTPTransport, sftp_homedir_test.transport_class)
118
122
        self.assertEqual(SFTPHomeDirServer, sftp_homedir_test.transport_server)
 
123
 
119
124
        self.assertEqual(HttpTransport, http_test.transport_class)
120
125
        self.assertEqual(HttpServer, http_test.transport_server)
121
126
        # self.assertEqual(FtpTransport, ftp_test.transport_class)
 
127
 
 
128
        self.assertEqual(MemoryTransport, memory_test.transport_class)
 
129
        self.assertEqual(MemoryServer, memory_test.transport_server)
122
130
        
 
131
        # we could test all of them for .id, but two is probably sufficient.
 
132
        self.assertEqual("bzrlib.tests.test_selftest."
 
133
                         "TestTransportProviderAdapter."
 
134
                         "test_adapter_sets_transport_class(MemoryServer)",
 
135
                         memory_test.id())
 
136
        self.assertEqual("bzrlib.tests.test_selftest."
 
137
                         "TestTransportProviderAdapter."
 
138
                         "test_adapter_sets_transport_class(LocalRelpathServer)",
 
139
                         local_relpath_test.id())