Rev 5: Really return an index from index.index_url. in http://people.ubuntu.com/~robertc/baz2.0/plugins/search/trunk

Robert Collins robertc at robertcollins.net
Sun Jun 8 07:54:54 BST 2008


At http://people.ubuntu.com/~robertc/baz2.0/plugins/search/trunk

------------------------------------------------------------
revno: 5
revision-id: robertc at robertcollins.net-20080608065453-gqzij4tj5qhk1088
parent: robertc at robertcollins.net-20080608064253-onrz4jo2slam32o3
committer: Robert Collins <robertc at robertcollins.net>
branch nick: trunk
timestamp: Sun 2008-06-08 16:54:53 +1000
message:
  Really return an index from index.index_url.
modified:
  index.py                       index.py-20080608055509-hnimeek7q8tctkqf-2
  tests/test_index.py            test_index.py-20080608055509-hnimeek7q8tctkqf-4
=== modified file 'index.py'
--- a/index.py	2008-06-08 06:42:53 +0000
+++ b/index.py	2008-06-08 06:54:53 +0000
@@ -28,6 +28,7 @@
     :return: The resulting search index.
     """
     branch = _mod_branch.Branch.open(url)
+    return Index()
 
 
 def open_index_url(url):
@@ -38,3 +39,7 @@
     :raises: NoSearchIndex if no index can be located.
     """
     raise errors.NoSearchIndex(url)
+
+
+class Index(object):
+    """A bzr content index."""

=== modified file 'tests/test_index.py'
--- a/tests/test_index.py	2008-06-08 06:42:53 +0000
+++ b/tests/test_index.py	2008-06-08 06:54:53 +0000
@@ -32,3 +32,8 @@
     def test_index_url_not_branch(self):
         self.assertRaises(NotBranchError, index.index_url,
             self.get_url())
+
+    def test_index_url_returns_index(self):
+        branch = self.make_branch('foo')
+        search_index = index.index_url(self.get_url('foo'))
+        self.assertIsInstance(search_index, index.Index)




More information about the bazaar-commits mailing list