Rev 5776: Stop using get_ConfigObjStore. in file:///home/vila/src/bzr/experimental/config/

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Apr 12 11:33:51 UTC 2011


At file:///home/vila/src/bzr/experimental/config/

------------------------------------------------------------
revno: 5776
revision-id: v.ladeuil+lp at free.fr-20110412113351-dtimomuvaq1q351y
parent: v.ladeuil+lp at free.fr-20110412112250-2b88a6qa3rh1d9n4
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: config-section-matchers
timestamp: Tue 2011-04-12 13:33:51 +0200
message:
  Stop using get_ConfigObjStore.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-04-12 11:22:50 +0000
+++ b/bzrlib/tests/test_config.py	2011-04-12 11:33:51 +0000
@@ -2144,17 +2144,17 @@
 
     scenarios = [('location', {'matcher': config.LocationMatcher})]
 
-    def get_store(self, file_name, content=None):
-        return get_ConfigObjStore(
-            self.get_readonly_transport(), file_name, content=content)
+    def get_store(self, file_name):
+        return config.ConfigObjStore(self.get_readonly_transport(), file_name)
 
     def test_no_matches_for_empty_stores(self):
-        store = self.get_store('foo.conf', '')
+        store = self.get_store('foo.conf')
+        store._load_from_string('')
         matcher = self.matcher(store, '/bar')
         self.assertEquals([], list(matcher.get_sections()))
 
     def test_build_doesnt_load_store(self):
-        store = self.get_store('foo.conf', '')
+        store = self.get_store('foo.conf')
         matcher = self.matcher(store, '/bar')
         self.assertFalse(store.loaded)
 
@@ -2184,15 +2184,17 @@
 
 class TestLocationMatcher(TestStore):
 
+    def get_store(self, file_name):
+        return config.ConfigObjStore(self.get_readonly_transport(), file_name)
+
     def test_more_specific_sections_first(self):
-        store = config.ConfigObjStore.from_string(
-            '''
+        store = self.get_store('foo.conf')
+        store._load_from_string('''
 [/foo]
 section=/foo
 [/foo/bar]
 section=/foo/bar
-''',
-            self.get_readonly_transport(), 'foo.conf', )
+''')
         self.assertEquals(['/foo', '/foo/bar'],
                           [section.id for section in store.get_sections()])
         matcher = config.LocationMatcher(store, '/foo/bar/baz')



More information about the bazaar-commits mailing list