move tests/ directory into migrate/tests (much better form) and fix all import lines and other minor issues

This commit is contained in:
Bob Farrell 2010-06-10 18:08:06 +01:00
parent 330b0ad2ec
commit fd8d313683
28 changed files with 33 additions and 35 deletions

View File

@ -6,7 +6,7 @@ from sqlalchemy import *
from migrate import changeset
from migrate.changeset import *
from migrate.changeset.schema import ColumnDelta
from tests import fixture
from migrate.tests import fixture
class TestAddDropColumn(fixture.DB):

View File

@ -8,7 +8,7 @@ from sqlalchemy.exc import *
from migrate.changeset import *
from migrate.changeset.exceptions import *
from tests import fixture
from migrate.tests import fixture
class CommonTestConstraint(fixture.DB):

View File

@ -61,6 +61,6 @@ def main(imports=None):
testRunner=Runner(verbosity=1))
from base import Base
from pathed import Pathed
from migrate.tests.fixture.pathed import Pathed
from shell import Shell
from database import DB,usedb

View File

@ -4,9 +4,6 @@
import re
import unittest
from nose.tools import raises, eq_
class Base(unittest.TestCase):
def setup_method(self,func=None):

View File

@ -12,8 +12,8 @@ from migrate.changeset import SQLA_06
from migrate.changeset.schema import ColumnDelta
from migrate.versioning.util import Memoize
from tests.fixture.base import Base
from tests.fixture.pathed import Pathed
from migrate.tests.fixture.base import Base
from migrate.tests.fixture.pathed import Pathed
@Memoize

View File

@ -6,7 +6,7 @@ import sys
import shutil
import tempfile
from tests.fixture import base
from migrate.tests.fixture import base
class Pathed(base.Base):

View File

@ -6,7 +6,7 @@ import sys
from scripttest import TestFileEnvironment
from tests.fixture.pathed import *
from migrate.tests.fixture.pathed import *
class Shell(Pathed):
@ -17,7 +17,8 @@ class Shell(Pathed):
self.env = TestFileEnvironment(
base_path=os.path.join(self.temp_usable_dir, 'env'),
script_path=[os.path.dirname(sys.executable)], # PATH to migrate development script folder
environ={'PYTHONPATH': '%s/tests' % (os.getcwd(),)},
environ={'PYTHONPATH':
os.path.join(os.getcwd(), 'migrate', 'tests')},
)
self.env.run("virtualenv %s" % self.env.base_path)
self.env.run("%s/bin/python setup.py install" % (self.env.base_path,), cwd=os.getcwd())

View File

@ -2,11 +2,11 @@ import doctest
import os
from tests import fixture
from migrate.tests import fixture
# Collect tests for all handwritten docs: doc/*.rst
dir = ('..','..','docs')
dir = ('..','..','..','docs')
absdir = (os.path.dirname(os.path.abspath(__file__)),)+dir
dirpath = os.path.join(*absdir)
files = [f for f in os.listdir(dirpath) if f.endswith('.rst')]

View File

@ -4,9 +4,9 @@
from migrate.versioning import api
from migrate.versioning.exceptions import *
from tests.fixture.pathed import *
from tests.fixture import models
from tests import fixture
from migrate.tests.fixture.pathed import *
from migrate.tests.fixture import models
from migrate.tests import fixture
class TestAPI(Pathed):

View File

@ -4,7 +4,7 @@
from migrate.versioning import cfgparse
from migrate.versioning.repository import *
from migrate.versioning.template import Template
from tests import fixture
from migrate.tests import fixture
class TestConfigParser(fixture.Base):

View File

@ -1,5 +1,5 @@
from sqlalchemy import select
from tests import fixture
from migrate.tests import fixture
class TestConnect(fixture.DB):
level=fixture.DB.TXN

View File

@ -6,7 +6,7 @@ import os
from migrate.versioning.genmodel import *
from migrate.versioning.exceptions import *
from tests import fixture
from migrate.tests import fixture
class TestModelGenerator(fixture.Pathed, fixture.DB):

View File

@ -1,7 +1,7 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
from tests import fixture
from migrate.tests import fixture
from migrate.versioning.util.keyedinstance import *
class TestKeydInstance(fixture.Base):

View File

@ -1,4 +1,4 @@
from tests import fixture
from migrate.tests import fixture
from migrate.versioning.pathed import *
class TestPathed(fixture.Base):

View File

@ -9,7 +9,7 @@ from migrate.versioning.repository import *
from migrate.versioning.script import *
from nose.tools import raises
from tests import fixture
from migrate.tests import fixture
class TestRepository(fixture.Pathed):

View File

@ -3,7 +3,7 @@
import os,shutil
from tests import fixture
from migrate.tests import fixture
from migrate.versioning.schema import *
from migrate.versioning import script

View File

@ -9,7 +9,7 @@ from migrate.versioning import script, exceptions, schemadiff
from sqlalchemy import *
from tests import fixture
from migrate.tests import fixture
class TestControlledSchema(fixture.Pathed, fixture.DB):

View File

@ -9,7 +9,7 @@ from nose.tools import eq_
from migrate.versioning import genmodel, schemadiff
from migrate.changeset import schema
from tests import fixture
from migrate.tests import fixture
class TestSchemaDiff(fixture.DB):

View File

@ -9,8 +9,8 @@ from migrate.versioning import exceptions, version, repository
from migrate.versioning.script import *
from migrate.versioning.util import *
from tests import fixture
from tests.fixture.models import tmp_sql_table
from migrate.tests import fixture
from migrate.tests.fixture.models import tmp_sql_table
class TestBaseScript(fixture.Pathed):
@ -226,7 +226,7 @@ class TestSqlScript(fixture.Pathed, fixture.DB):
# populate python script
contents = open(script_path, 'r').read()
contents = contents.replace("pass", "tmp_sql_table.create(migrate_engine)")
contents = 'from tests.fixture.models import tmp_sql_table\n' + contents
contents = 'from migrate.tests.fixture.models import tmp_sql_table\n' + contents
f = open(script_path, 'w')
f.write(contents)
f.close()

View File

@ -15,8 +15,8 @@ from nose.plugins.skip import SkipTest
from migrate.versioning.repository import Repository
from migrate.versioning import genmodel, shell, api
from migrate.versioning.exceptions import *
from tests.fixture import Shell, DB, usedb
from tests.fixture import models
from migrate.tests.fixture import Shell, DB, usedb
from migrate.tests.fixture import models
class TestShellCommands(Shell):
@ -450,8 +450,8 @@ class TestShellDatabase(Shell, DB):
repos_name = 'repos_name'
repos_path = self.tmp()
script_path = self.tmp_py()
model_module = 'tests.fixture.models:meta_rundiffs'
old_model_module = 'tests.fixture.models:meta_old_rundiffs'
model_module = 'migrate.tests.fixture.models:meta_rundiffs'
old_model_module = 'migrate.tests.fixture.models:meta_old_rundiffs'
# Create empty repository.
self.meta = MetaData(self.engine, reflect=True)

View File

@ -8,7 +8,7 @@ import migrate.versioning.templates
from migrate.versioning.template import *
from migrate.versioning import api
from tests import fixture
from migrate.tests import fixture
class TestTemplate(fixture.Pathed):

View File

@ -5,7 +5,7 @@ import os
from sqlalchemy import *
from tests import fixture
from migrate.tests import fixture
from migrate.versioning.util import *

View File

@ -4,7 +4,7 @@
from migrate.versioning.version import *
from migrate.versioning.exceptions import *
from tests import fixture
from migrate.tests import fixture
class TestVerNum(fixture.Base):