/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_registry.py

  • Committer: John Arbash Meinel
  • Date: 2008-03-14 16:32:01 UTC
  • mfrom: (3277 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3280.
  • Revision ID: john@arbash-meinel.com-20080314163201-33r5errgr41hzaci
[merge] bzr.dev 3277, cleanup NEWS indentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
                         ], sorted((key, a_registry.get_info(key))
188
188
                                    for key in a_registry.keys()))
189
189
 
 
190
    def test_get_prefix(self):
 
191
        my_registry = registry.Registry()
 
192
        http_object = object()
 
193
        sftp_object = object()
 
194
        my_registry.register('http:', http_object)
 
195
        my_registry.register('sftp:', sftp_object)
 
196
        found_object, suffix = my_registry.get_prefix('http://foo/bar')
 
197
        self.assertEqual('//foo/bar', suffix)
 
198
        self.assertIs(http_object, found_object)
 
199
        self.assertIsNot(sftp_object, found_object)
 
200
        found_object, suffix = my_registry.get_prefix('sftp://baz/qux')
 
201
        self.assertEqual('//baz/qux', suffix)
 
202
        self.assertIs(sftp_object, found_object)
 
203
 
190
204
 
191
205
class TestRegistryWithDirs(TestCaseInTempDir):
192
206
    """Registry tests that require temporary dirs"""