Commit a13e913c authored by Jérome Perrin's avatar Jérome Perrin

tests: use _ instead of - in environment variables

This is not really standard and not supported when /bin/sh is dash
parent 756f14bb
......@@ -139,7 +139,7 @@ cmd = [sys.executable, '-c',
'-mZqNxd', tmpeggs]
find_links = os.environ.get(
'bootstrap-testing-find-links',
'bootstrap_testing_find_links',
options.find_links or
('http://downloads.buildout.org/'
if options.accept_buildout_test_releases else None)
......
......@@ -3394,8 +3394,8 @@ extdemo_setup_py = r"""
import os, sys
from distutils.core import setup, Extension
if os.environ.get('test-variable'):
print("Have environment test-variable: %%s" %% os.environ['test-variable'])
if os.environ.get('test_variable'):
print("Have environment test_variable: %%s" %% os.environ['test_variable'])
setup(name = "extdemo", version = "%s", url="http://www.zope.org",
author="Demo", author_email="demo@demo.com",
......@@ -3539,7 +3539,7 @@ def bootstrapSetup(test):
ws = getWorkingSetWithBuildoutEgg(test)
makeNewRelease('zc.buildout', ws, sample_eggs, '2.0.0')
makeNewRelease('zc.buildout', ws, sample_eggs, '22.0.0')
os.environ['bootstrap-testing-find-links'] = test.globs['link_server']
os.environ['bootstrap_testing_find_links'] = test.globs['link_server']
test.globs['bootstrap_py'] = bootstrap_py
normalize_bang = (
......
......@@ -246,7 +246,7 @@ We won't get an update.
- zc.recipe.egg.egg-link
But if we run the buildout in the default on-line and newest modes, we
will. This time we also get the test-variable message again, because the new
will. This time we also get the test_variable message again, because the new
version is imported:
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
......@@ -318,8 +318,8 @@ recipe was run.
...
... def install(self):
... logging.getLogger(self.name).info(
... 'test-variable left over: %s' % (
... 'test-variable' in os.environ))
... 'test_variable left over: %s' % (
... 'test_variable' in os.environ))
... return []
...
... def update(self):
......@@ -345,7 +345,7 @@ Create our buildout:
... parts = extdemo checkenv
...
... [extdemo-env]
... test-variable = foo
... test_variable = foo
...
... [extdemo]
... recipe = zc.recipe.egg:custom
......@@ -363,13 +363,13 @@ Create our buildout:
Uninstalling demo.
Uninstalling extdemo.
Installing extdemo.
Have environment test-variable: foo
Have environment test_variable: foo
zip_safe flag not set; analyzing archive contents...
Installing checkenv.
...
The setup.py also printed out that we have set the environment `test-variable`
The setup.py also printed out that we have set the environment `test_variable`
to foo. After the buildout the variable is reset to its original value (i.e.
removed).
......@@ -377,14 +377,14 @@ When an environment variable has a value before zc.recipe.egg:custom is run,
the original value will be restored:
>>> import os
>>> os.environ['test-variable'] = 'bar'
>>> os.environ['test_variable'] = 'bar'
>>> print_(system(buildout), end='')
Develop: '/sample-buildout/recipes'
Updating extdemo.
Updating checkenv.
checkenv: test-variable left over: True
checkenv: test_variable left over: True
>>> os.environ['test-variable']
>>> os.environ['test_variable']
'bar'
......@@ -399,7 +399,7 @@ are interpolated with os.environ before the're set:
... parts = extdemo checkenv
...
... [extdemo-env]
... test-variable = foo:%%(test-variable)s
... test_variable = foo:%%(test_variable)s
...
... [extdemo]
... recipe = zc.recipe.egg:custom
......@@ -416,14 +416,14 @@ are interpolated with os.environ before the're set:
Develop: '/sample-buildout/recipes'
Uninstalling extdemo.
Installing extdemo.
Have environment test-variable: foo:bar
Have environment test_variable: foo:bar
zip_safe flag not set; analyzing archive contents...
Updating checkenv.
...
>>> os.environ['test-variable']
>>> os.environ['test_variable']
'bar'
>>> del os.environ['test-variable']
>>> del os.environ['test_variable']
Create a clean buildout.cfg w/o the checkenv recipe, and delete the recipe:
......
  • 93369b04 would be squashed with this commit.

  • Ah yes, it's same. I'm changing this commit to be a fixup of 93369b04 so that git rebase --autosquash can understand this.

  • I was too brief. A fixup is not ideal because the subject of my commit does not apply here. I've just amended.

    Edited by Julien Muchembled
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment