Rev 5763: Clarify some constraints for tests writers. in file:///home/vila/src/bzr/experimental/config/

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Apr 6 16:29:09 UTC 2011


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

------------------------------------------------------------
revno: 5763
revision-id: v.ladeuil+lp at free.fr-20110406162909-q5fqc50dlegc10km
parent: v.ladeuil+lp at free.fr-20110406161725-m78h5403y8munm0f
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: config-abstract-store
timestamp: Wed 2011-04-06 18:29:09 +0200
message:
  Clarify some constraints for tests writers.
-------------- next part --------------
=== modified file 'bzrlib/tests/test_config.py'
--- a/bzrlib/tests/test_config.py	2011-04-06 16:17:25 +0000
+++ b/bzrlib/tests/test_config.py	2011-04-06 16:29:09 +0000
@@ -1890,6 +1890,19 @@
 
 
 def get_ConfigObjStore(transport, file_name, content=None):
+    """Build a ConfigObjStore.
+
+    :param transport: The transport where the store lives.
+
+    :param file_name: The name of the store.
+
+    :param content: A provided content to inject into the built store.
+
+    If provided, the content is added to the store but without saving it on
+    disk. It should be a string or a unicode string in the ConfigObj syntax.
+    While this poses a constraint on other store implementations, it keeps a
+    simple syntax usable by test writers.
+    """
     if content is None:
         store = config.ConfigObjStore(transport, file_name)
     else:
@@ -1927,9 +1940,8 @@
         store = self.get_store('foo.conf', '')
         self.assertEquals(False, store.loaded)
         store.load()
+        # We loaded the store from the provided content
         self.assertEquals(True, store.loaded)
-        # We use from_string and don't save, so the file shouldn't be created
-        self.failIfExists('foo.conf')
 
     def test_get_no_sections_for_empty(self):
         store = self.get_store('foo.conf', '')



More information about the bazaar-commits mailing list