[Checkins] SVN: zc.buildout/trunk/src/zc/buildout/testing. At the start of a test, change the working directory to the sample

Jim Fulton jim at zope.com
Mon Oct 16 16:27:48 EDT 2006


Log message for revision 70724:
  At the start of a test, change the working directory to the sample
  buildout.
  

Changed:
  U   zc.buildout/trunk/src/zc/buildout/testing.py
  U   zc.buildout/trunk/src/zc/buildout/testing.txt

-=-
Modified: zc.buildout/trunk/src/zc/buildout/testing.py
===================================================================
--- zc.buildout/trunk/src/zc/buildout/testing.py	2006-10-16 17:44:22 UTC (rev 70723)
+++ zc.buildout/trunk/src/zc/buildout/testing.py	2006-10-16 20:27:47 UTC (rev 70724)
@@ -162,14 +162,16 @@
 
     sample = tmpdir('sample-buildout')
 
+    os.chdir(sample)
+
     # Create a basic buildout.cfg to avoid a warning from buildout:
-    open(os.path.join(sample, 'buildout.cfg'), 'w').write(
+    open('buildout.cfg', 'w').write(
         "[buildout]\nparts =\n"
         )
 
     # Use the buildout bootstrap command to create a buildout
     zc.buildout.buildout.Buildout(
-        os.path.join(sample, 'buildout.cfg'),
+        'buildout.cfg',
         [('buildout', 'log-level', 'WARNING'),
          # trick bootstrap into putting the buildout develop egg
          # in the eggs dir.
@@ -179,7 +181,7 @@
     
     # Create the develop-eggs dir, which didn't get created the usual
     # way due to thr trick above:
-    os.mkdir(os.path.join(sample, 'develop-eggs'))
+    os.mkdir('develop-eggs')
 
     def start_server(path):
         port, thread = _start_server(path, name=path)

Modified: zc.buildout/trunk/src/zc/buildout/testing.txt
===================================================================
--- zc.buildout/trunk/src/zc/buildout/testing.txt	2006-10-16 17:44:22 UTC (rev 70723)
+++ zc.buildout/trunk/src/zc/buildout/testing.txt	2006-10-16 20:27:47 UTC (rev 70724)
@@ -10,7 +10,9 @@
 ---------------------------------------
 
 The buildoutSetup function can be used as a doctest setup function.
-It performs adds a number of names to the test namespace:
+It creates a sample buildout that can be used by tests, changing the
+current working directory to the sample_buildout. It also adds a
+number of names to the test namespace:
 
 ``sample_buildout``
     This is the name of a buildout with a basic configuration.



More information about the Checkins mailing list