[Checkins] SVN: z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/README.txt Update tests.

Uli Fouquet uli at gnufix.de
Tue Aug 18 18:24:30 EDT 2009


Log message for revision 102923:
  Update tests.
  

Changed:
  U   z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/README.txt

-=-
Modified: z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/README.txt
===================================================================
--- z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/README.txt	2009-08-18 22:24:03 UTC (rev 102922)
+++ z3c.recipe.mkdir/trunk/z3c/recipe/mkdir/README.txt	2009-08-18 22:24:30 UTC (rev 102923)
@@ -119,3 +119,87 @@
 
   >>> ls('myrootdir', 'other', 'dir')
   d  finaldir
+
+
+Things to be aware of
+=====================
+
+If you change the setting of some path, the old directory and all its
+contents will be lost:
+
+  >>> write('buildout.cfg',
+  ... '''
+  ... [buildout]
+  ... parts = mydir
+  ... offline = true
+  ...
+  ... [mydir]
+  ... recipe = z3c.recipe.mkdir
+  ... path = path1
+  ... ''')
+
+  >>> print system(join('bin', 'buildout')),
+  Uninstalling mydir.
+  Installing mydir.
+
+  >>> write(join('path1', 'myfile'), 'blah\n')
+  >>> ls('path1')
+  -  myfile
+
+Now we switch the setting of mydir to ``path2``:
+
+  >>> write('buildout.cfg',
+  ... '''
+  ... [buildout]
+  ... parts = mydir
+  ... offline = true
+  ...
+  ... [mydir]
+  ... recipe = z3c.recipe.mkdir
+  ... path = path2
+  ... ''')
+
+  >>> print system(join('bin', 'buildout'))
+  Uninstalling mydir.
+  Installing mydir.
+  <BLANKLINE>
+
+  >>> ls('path1')
+  Traceback (most recent call last):
+  OSError: [Errno ...] No such file or directory: 'path1'
+
+
+Things, one should not do
+=========================
+
+If the path given already contains a file, an error is raised:
+
+  >>> write('buildout.cfg',
+  ... '''
+  ... [buildout]
+  ... parts = mydir
+  ... offline = true
+  ...
+  ... [mydir]
+  ... recipe = z3c.recipe.mkdir
+  ... path = myrootdir/somefile/foo
+  ... ''')
+
+Now we create the first part of the path beforehand:
+
+  >>> import os
+  >>> os.mkdir('myrootdir')
+
+And make the second part of the path a file:
+
+  >>> write(join('myrootdir', 'somefile'),
+  ... '''
+  ... blah
+  ... ''')
+
+  >>> print system(join('bin', 'buildout')),
+  Uninstalling mydir.
+  Installing mydir.
+  While:
+    Installing mydir.
+  Error: Cannot create directory: /.../myrootdir/somefile. It's a file.



More information about the Checkins mailing list