mirror of
https://github.com/kennethreitz-archive/python-build.git
synced 2026-06-05 23:30:18 +00:00
release 0.9
This commit is contained in:
+2
-3
@@ -2,17 +2,16 @@ import os
|
||||
import shutil
|
||||
|
||||
PYTHONBREW_ROOT = '/tmp/pythonbrew.test'
|
||||
TESTPY_FILE = '/tmp/pythonbrew_test.py'
|
||||
TESTPY_VERSION = ['2.4.6', '2.5.5', '2.6.6', '3.2']
|
||||
def cleanall():
|
||||
if os.path.isdir(PYTHONBREW_ROOT):
|
||||
shutil.rmtree(PYTHONBREW_ROOT)
|
||||
if os.path.isfile(TESTPY_FILE):
|
||||
os.remove(TESTPY_FILE)
|
||||
|
||||
def setup():
|
||||
os.environ['PYTHONBREW_ROOT'] = PYTHONBREW_ROOT
|
||||
cleanall()
|
||||
from pythonbrew.installer import install_pythonbrew
|
||||
install_pythonbrew()
|
||||
|
||||
def teardown():
|
||||
cleanall()
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
def test_install_pythonbrew():
|
||||
from pythonbrew.installer import install_pythonbrew
|
||||
install_pythonbrew()
|
||||
@@ -1,4 +1,7 @@
|
||||
from tests import TESTPY_FILE
|
||||
from tests import PYTHONBREW_ROOT
|
||||
import os
|
||||
|
||||
TESTPY_FILE = os.path.join(PYTHONBREW_ROOT, 'etc', 'testfile.py')
|
||||
|
||||
class PyOptions(object):
|
||||
pythons = []
|
||||
@@ -0,0 +1,31 @@
|
||||
from tests import PYTHONBREW_ROOT
|
||||
import os
|
||||
|
||||
BUILDOUT_DIR = os.path.join(PYTHONBREW_ROOT, 'etc', 'buildout')
|
||||
BUILDOUT_CONF = os.path.join(BUILDOUT_DIR, 'buildout.cfg')
|
||||
|
||||
def _create_buildout_cfg():
|
||||
if not os.path.isdir(BUILDOUT_DIR):
|
||||
os.makedirs(BUILDOUT_DIR)
|
||||
fp = open(BUILDOUT_CONF, 'w')
|
||||
fp.write("""[buildout]
|
||||
parts = test
|
||||
develop =
|
||||
|
||||
[test]
|
||||
recipe =
|
||||
eggs =""")
|
||||
fp.close()
|
||||
|
||||
class BuildoutOptions(object):
|
||||
python = '2.6.6'
|
||||
|
||||
def test_buildout():
|
||||
from pythonbrew.commands.buildout import BuildoutCommand
|
||||
|
||||
# Runs the buildout
|
||||
_create_buildout_cfg()
|
||||
os.chdir(BUILDOUT_DIR)
|
||||
c = BuildoutCommand()
|
||||
c.run_command(BuildoutOptions(), [])
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
class VenvOptions(object):
|
||||
python = '2.6.6'
|
||||
all = False
|
||||
|
||||
def test_venv():
|
||||
from pythonbrew.commands.venv import VenvCommand
|
||||
c = VenvCommand()
|
||||
c.run_command(VenvOptions(), ['create', 'aaa'])
|
||||
c.run_command(VenvOptions(), ['list'])
|
||||
c.run_command(VenvOptions(), ['use', 'aaa'])
|
||||
c.run_command(VenvOptions(), ['delete', 'aaa'])
|
||||
@@ -0,0 +1,4 @@
|
||||
def test_clean():
|
||||
from pythonbrew.commands.cleanup import CleanupCommand
|
||||
c = CleanupCommand()
|
||||
c.run_command(None, None)
|
||||
Reference in New Issue
Block a user