summaryrefslogtreecommitdiffstats
path: root/test/virtualenv
diff options
context:
space:
mode:
authorPaweł Tomulik <ptomulik@meil.pw.edu.pl>2018-11-07 00:55:58 (GMT)
committerPaweł Tomulik <ptomulik@meil.pw.edu.pl>2018-11-10 09:24:35 (GMT)
commit0414380dec2104dedc163e7489f445621ef0e5f6 (patch)
tree1f5aabd6aea8053152d975e97c72a90716faf8a6 /test/virtualenv
parent08863caeef77c0a579f774bd831e289124dd65e0 (diff)
downloadSCons-0414380dec2104dedc163e7489f445621ef0e5f6.zip
SCons-0414380dec2104dedc163e7489f445621ef0e5f6.tar.gz
SCons-0414380dec2104dedc163e7489f445621ef0e5f6.tar.bz2
corrections after bdbaddog's code review
Diffstat (limited to 'test/virtualenv')
-rw-r--r--test/virtualenv/activated/option/enable-virtualenv.py14
-rw-r--r--test/virtualenv/activated/option/ignore-virtualenv.py12
-rw-r--r--test/virtualenv/activated/virtualenv_activated_python.py12
-rw-r--r--test/virtualenv/activated/virtualenv_detect_virtualenv.py8
-rw-r--r--test/virtualenv/always/virtualenv_global_function.py4
-rw-r--r--test/virtualenv/regularenv/virtualenv_detect_regularenv.py8
-rw-r--r--test/virtualenv/unactivated/virtualenv_unactivated_python.py12
7 files changed, 35 insertions, 35 deletions
diff --git a/test/virtualenv/activated/option/enable-virtualenv.py b/test/virtualenv/activated/option/enable-virtualenv.py
index dc3fa76..a5ceecc 100644
--- a/test/virtualenv/activated/option/enable-virtualenv.py
+++ b/test/virtualenv/activated/option/enable-virtualenv.py
@@ -29,25 +29,25 @@ Ensure that the --enable-virtualenv flag works.
"""
import TestSCons
-import SCons.Platform.VE
+import SCons.Platform.virtualenv
import sys
import os
import re
test = TestSCons.TestSCons()
-if SCons.Platform.VE.virtualenv_enabled_by_default:
+if SCons.Platform.virtualenv.virtualenv_enabled_by_default:
test.skip_test("Virtualenv support enabled by default, the option --enable-virtualenv is unavailable, skipping\n")
-if not SCons.Platform.VE.Virtualenv():
+if not SCons.Platform.virtualenv.Virtualenv():
test.skip_test("No virtualenv detected, skipping\n")
-if not SCons.Platform.VE.select_paths_in_venv(os.getenv('PATH','')):
+if not SCons.Platform.virtualenv.select_paths_in_venv(os.getenv('PATH','')):
test.skip_test("Virtualenv detected but looks like unactivated, skipping\n")
test.write('SConstruct', """
import sys
-import SCons.Platform.VE
+import SCons.Platform.virtualenv
env = DefaultEnvironment(tools=[])
print("sys.executable: %r" % sys.executable)
print("env.WhereIs('python'): %r" % env.WhereIs('python'))
@@ -77,9 +77,9 @@ can't determine env.WhereIs('python') from stdout:
python = eval(m.group('py'))
-test.fail_test(not SCons.Platform.VE.IsInVirtualenv(interpreter),
+test.fail_test(not SCons.Platform.virtualenv.IsInVirtualenv(interpreter),
message="sys.executable points outside of virtualenv")
-test.fail_test(not SCons.Platform.VE.IsInVirtualenv(python),
+test.fail_test(not SCons.Platform.virtualenv.IsInVirtualenv(python),
message="env.WhereIs('python') points to virtualenv")
test.pass_test()
diff --git a/test/virtualenv/activated/option/ignore-virtualenv.py b/test/virtualenv/activated/option/ignore-virtualenv.py
index 05b462d..ac6f945 100644
--- a/test/virtualenv/activated/option/ignore-virtualenv.py
+++ b/test/virtualenv/activated/option/ignore-virtualenv.py
@@ -29,22 +29,22 @@ Ensure that the --ignore-virtualenv flag works.
"""
import TestSCons
-import SCons.Platform.VE
+import SCons.Platform.virtualenv
import sys
import os
import re
test = TestSCons.TestSCons()
-if not SCons.Platform.VE.Virtualenv():
+if not SCons.Platform.virtualenv.Virtualenv():
test.skip_test("No virtualenv detected, skipping\n")
-if not SCons.Platform.VE.select_paths_in_venv(os.getenv('PATH','')):
+if not SCons.Platform.virtualenv.select_paths_in_venv(os.getenv('PATH','')):
test.skip_test("Virtualenv detected but looks like unactivated, skipping\n")
test.write('SConstruct', """
import sys
-import SCons.Platform.VE
+import SCons.Platform.virtualenv
env = DefaultEnvironment(tools=[])
print("sys.executable: %s" % repr(sys.executable))
print("env.WhereIs('python'): %s" % repr(env.WhereIs('python')))
@@ -76,9 +76,9 @@ can't determine env.WhereIs('python') from stdout:
python = eval(m.group('py'))
-test.fail_test(not SCons.Platform.VE.IsInVirtualenv(interpreter),
+test.fail_test(not SCons.Platform.virtualenv.IsInVirtualenv(interpreter),
message="sys.executable points outside of virtualenv")
-test.fail_test(SCons.Platform.VE.IsInVirtualenv(python),
+test.fail_test(SCons.Platform.virtualenv.IsInVirtualenv(python),
message="env.WhereIs('python') points to virtualenv")
test.pass_test()
diff --git a/test/virtualenv/activated/virtualenv_activated_python.py b/test/virtualenv/activated/virtualenv_activated_python.py
index 3f591d6..c673ae1 100644
--- a/test/virtualenv/activated/virtualenv_activated_python.py
+++ b/test/virtualenv/activated/virtualenv_activated_python.py
@@ -32,17 +32,17 @@ environment or in unactivated virtualenv.
"""
import TestSCons
-import SCons.Platform.VE
+import SCons.Platform.virtualenv
import sys
import os
import re
test = TestSCons.TestSCons()
-if not SCons.Platform.VE.Virtualenv():
+if not SCons.Platform.virtualenv.Virtualenv():
test.skip_test("No virtualenv detected, skipping\n")
-if not SCons.Platform.VE.select_paths_in_venv(os.getenv('PATH')):
+if not SCons.Platform.virtualenv.select_paths_in_venv(os.getenv('PATH')):
test.skip_test("Virtualenv detected but looks like unactivated, skipping\n")
@@ -53,7 +53,7 @@ print("sys.executable: %s" % repr(sys.executable))
print("env.WhereIs('python'): %s" % repr(env.WhereIs('python')))
""")
-if SCons.Platform.VE.virtualenv_enabled_by_default:
+if SCons.Platform.virtualenv.virtualenv_enabled_by_default:
test.run(['-Q'])
else:
test.run(['-Q', '--enable-virtualenv'])
@@ -82,9 +82,9 @@ can't determine env.WhereIs('python') from stdout:
python = eval(m.group('py'))
# runing in activated virtualenv (after "activate") - PATH includes virtualenv's bin directory
-test.fail_test(not SCons.Platform.VE.IsInVirtualenv(interpreter),
+test.fail_test(not SCons.Platform.virtualenv.IsInVirtualenv(interpreter),
message="sys.executable points outside of virtualenv")
-test.fail_test(not SCons.Platform.VE.IsInVirtualenv(python),
+test.fail_test(not SCons.Platform.virtualenv.IsInVirtualenv(python),
message="env.WhereIs('python') points outside of virtualenv")
test.pass_test()
diff --git a/test/virtualenv/activated/virtualenv_detect_virtualenv.py b/test/virtualenv/activated/virtualenv_detect_virtualenv.py
index 0eba385..2c00793 100644
--- a/test/virtualenv/activated/virtualenv_detect_virtualenv.py
+++ b/test/virtualenv/activated/virtualenv_detect_virtualenv.py
@@ -25,16 +25,16 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
-Check if SCons.Platform.VE.Virtualenv() works in SConscripts.
+Check if SCons.Platform.virtualenv.Virtualenv() works in SConscripts.
"""
import TestSCons
-import SCons.Platform.VE
+import SCons.Platform.virtualenv
import sys
test = TestSCons.TestSCons()
-ve = SCons.Platform.VE.Virtualenv()
+ve = SCons.Platform.virtualenv.Virtualenv()
if not ve:
test.skip_test("Virtualenv is not active, skipping\n")
@@ -42,7 +42,7 @@ test.write('SConstruct', """
print("virtualenv: %r" % Virtualenv())
""")
-if SCons.Platform.VE.virtualenv_enabled_by_default:
+if SCons.Platform.virtualenv.virtualenv_enabled_by_default:
test.run(['-Q'])
else:
test.run(['-Q', '--enable-virtualenv'])
diff --git a/test/virtualenv/always/virtualenv_global_function.py b/test/virtualenv/always/virtualenv_global_function.py
index 18f93f8..8f2c291 100644
--- a/test/virtualenv/always/virtualenv_global_function.py
+++ b/test/virtualenv/always/virtualenv_global_function.py
@@ -31,7 +31,7 @@ contains the virtualenv's bin path).
"""
import TestSCons
-import SCons.Platform.VE
+import SCons.Platform.virtualenv
import re
test = TestSCons.TestSCons()
@@ -53,7 +53,7 @@ can't determine Virtualenv() result from stdout:
""" % s)
scons_ve = m.group('ve')
-our_ve = "%r" % SCons.Platform.VE.Virtualenv()
+our_ve = "%r" % SCons.Platform.virtualenv.Virtualenv()
# runing in activated virtualenv (after "activate") - PATH includes virtualenv's bin directory
test.fail_test(scons_ve != our_ve,
diff --git a/test/virtualenv/regularenv/virtualenv_detect_regularenv.py b/test/virtualenv/regularenv/virtualenv_detect_regularenv.py
index e5dbc61..57a0d4f 100644
--- a/test/virtualenv/regularenv/virtualenv_detect_regularenv.py
+++ b/test/virtualenv/regularenv/virtualenv_detect_regularenv.py
@@ -25,23 +25,23 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
-Check if SCons.Platform.VE.Virtualenv() works in SConscript.
+Check if SCons.Platform.virtualenv.Virtualenv() works in SConscript.
"""
import TestSCons
-import SCons.Platform.VE
+import SCons.Platform.virtualenv
import sys
test = TestSCons.TestSCons()
-if SCons.Platform.VE.Virtualenv():
+if SCons.Platform.virtualenv.Virtualenv():
test.skip_test("Virtualenv is active, skipping\n")
test.write('SConstruct', """
print("virtualenv: %r" % Virtualenv())
""")
-if SCons.Platform.VE.virtualenv_enabled_by_default:
+if SCons.Platform.virtualenv.virtualenv_enabled_by_default:
test.run(['-Q'])
else:
test.run(['-Q', '--enable-virtualenv'])
diff --git a/test/virtualenv/unactivated/virtualenv_unactivated_python.py b/test/virtualenv/unactivated/virtualenv_unactivated_python.py
index a087318..a4dc240 100644
--- a/test/virtualenv/unactivated/virtualenv_unactivated_python.py
+++ b/test/virtualenv/unactivated/virtualenv_unactivated_python.py
@@ -32,17 +32,17 @@ a regular environment or in an activated virtualenv.
"""
import TestSCons
-import SCons.Platform.VE
+import SCons.Platform.virtualenv
import sys
import os
import re
test = TestSCons.TestSCons()
-if not SCons.Platform.VE.Virtualenv():
+if not SCons.Platform.virtualenv.Virtualenv():
test.skip_test("No virtualenv detected, skipping\n")
-if SCons.Platform.VE.select_paths_in_venv(os.getenv('PATH')):
+if SCons.Platform.virtualenv.select_paths_in_venv(os.getenv('PATH')):
test.skip_test("Virtualenv detected and it looks like activated, skipping\n")
test.write('SConstruct', """
@@ -52,7 +52,7 @@ print("sys.executable: %s" % repr(sys.executable))
print("env.WhereIs('python'): %s" % repr(env.WhereIs('python')))
""")
-if SCons.Platform.VE.virtualenv_enabled_by_default:
+if SCons.Platform.virtualenv.virtualenv_enabled_by_default:
test.run(['-Q'])
else:
test.run(['-Q', '--enable-virtualenv'])
@@ -81,9 +81,9 @@ can't determine env.WhereIs('python') from stdout:
python = eval(m.group('py'))
# running without activating virtualenv (by just /path/to/virtualenv/bin/python runtest.py ...).
-test.fail_test(not SCons.Platform.VE.IsInVirtualenv(interpreter),
+test.fail_test(not SCons.Platform.virtualenv.IsInVirtualenv(interpreter),
message="sys.executable points outside of virtualenv")
-test.fail_test(SCons.Platform.VE.IsInVirtualenv(python),
+test.fail_test(SCons.Platform.virtualenv.IsInVirtualenv(python),
message="env.WhereIs('python') points to virtualenv")
test.pass_test()