release 0.9

This commit is contained in:
utahta
2011-07-22 19:09:59 +09:00
parent cfdd193ffe
commit e033edcda0
30 changed files with 403 additions and 48 deletions
+2 -3
View File
@@ -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()
-3
View File
@@ -1,3 +0,0 @@
def test_install_pythonbrew():
from pythonbrew.installer import install_pythonbrew
install_pythonbrew()
+4 -1
View File
@@ -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 = []
+31
View File
@@ -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(), [])
+11
View File
@@ -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'])
+4
View File
@@ -0,0 +1,4 @@
def test_clean():
from pythonbrew.commands.cleanup import CleanupCommand
c = CleanupCommand()
c.run_command(None, None)