[Checkins] SVN: z3c.recipe.usercrontab/trunk/src/z3c/recipe/usercrontab/README.txt Added test for mixing environment variables
Reinout van Rees
reinout at vanrees.org
Mon Jun 15 06:36:43 EDT 2009
Log message for revision 100965:
Added test for mixing environment variables
Changed:
U z3c.recipe.usercrontab/trunk/src/z3c/recipe/usercrontab/README.txt
-=-
Modified: z3c.recipe.usercrontab/trunk/src/z3c/recipe/usercrontab/README.txt
===================================================================
--- z3c.recipe.usercrontab/trunk/src/z3c/recipe/usercrontab/README.txt 2009-06-15 10:16:10 UTC (rev 100964)
+++ z3c.recipe.usercrontab/trunk/src/z3c/recipe/usercrontab/README.txt 2009-06-15 10:36:43 UTC (rev 100965)
@@ -14,6 +14,10 @@
>>> from z3c.recipe.usercrontab.usercrontab import UserCrontabManager
>>> c = UserCrontabManager()
+
+Entry and environment handling
+------------------------------
+
For these tests, we fake a crontab by filling the list of cron entries
for this object:
@@ -114,6 +118,46 @@
MAILTO=""
@reboot echo "No-one will see this"
+When introducing a new environment variable to leave markers which buildout is
+used, the mix between the environment is right:
+
+ >>> c.crontab = ['MAILTO=""', 'BUILDOUT=my/path', '@reboot echo "no mailto, my/path"']
+ >>> print c
+ MAILTO=""
+ BUILDOUT=my/path
+ @reboot echo "no mailto, my/path"
+ >>> c.add_entry('@reboot echo "no mailto, my/other"', MAILTO="", BUILDOUT="my/other")
+ >>> print c
+ MAILTO=""
+ BUILDOUT=my/path
+ @reboot echo "no mailto, my/path"
+ BUILDOUT=my/other
+ @reboot echo "no mailto, my/other"
+ >>> c.add_entry('@reboot echo "no mailto, my/other, bla"', MAILTO="", BUILDOUT="my/other")
+ >>> print c
+ MAILTO=""
+ BUILDOUT=my/path
+ @reboot echo "no mailto, my/path"
+ BUILDOUT=my/other
+ @reboot echo "no mailto, my/other, bla"
+ @reboot echo "no mailto, my/other"
+ >>> c.add_entry('@reboot echo "mailto example, my/path"',
+ ... MAILTO="something at example.com", BUILDOUT="my/path")
+ >>> print c
+ MAILTO=""
+ BUILDOUT=my/path
+ @reboot echo "no mailto, my/path"
+ BUILDOUT=my/other
+ @reboot echo "no mailto, my/other, bla"
+ @reboot echo "no mailto, my/other"
+ MAILTO=something at example.com
+ BUILDOUT=my/path
+ @reboot echo "mailto example, my/path"
+
+
+Read/write crontab methods
+--------------------------
+
Next, test the read_crontab and write_crontab methods; we'll use
``cat`` and a temporary file to not modifiy the crontab of the user
running these tests:
More information about the Checkins
mailing list