summaryrefslogtreecommitdiff
path: root/test/base
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-07-16 17:29:02 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2012-07-16 17:29:02 -0400
commitce9a702dbd52946487f45b98ef20d1b7783facb6 (patch)
tree7273a1982850bf9975509295d766053d4fe822b1 /test/base
parent1dc09bf6ede97ef08b2c8c0886a03b44bba735ff (diff)
downloadsqlalchemy-ce9a702dbd52946487f45b98ef20d1b7783facb6.tar.gz
- express most of the orm.util functions in terms of the inspection system
- modify inspection system: 1. raise a new exception for any case where the inspection context can't be returned. this supersedes the "not mapped" errors. 2. don't configure mappers on a mapper inspection. this allows the inspectors to be used during mapper config time. instead, the mapper configures on "with_polymorphic_selectable" now, which is needed for all queries - add a bunch of new "is_XYZ" attributes to inspectors - finish making the name change of "compile" -> "configure", for some reason this was only done partially
Diffstat (limited to 'test/base')
-rw-r--r--test/base/test_inspect.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/base/test_inspect.py b/test/base/test_inspect.py
index 1e16fa4aa..c5a60481b 100644
--- a/test/base/test_inspect.py
+++ b/test/base/test_inspect.py
@@ -1,6 +1,6 @@
"""test the inspection registry system."""
-from test.lib.testing import eq_, assert_raises
+from test.lib.testing import eq_, assert_raises_message
from sqlalchemy import exc, util
from sqlalchemy import inspection, inspect
from test.lib import fixtures
@@ -8,8 +8,7 @@ from test.lib import fixtures
class TestFixture(object):
pass
-class TestEvents(fixtures.TestBase):
- """Test class- and instance-level event registration."""
+class TestInspection(fixtures.TestBase):
def tearDown(self):
for type_ in list(inspection._registrars):
@@ -28,6 +27,16 @@ class TestEvents(fixtures.TestBase):
insp = inspect(somefoo)
assert insp["insp"] is somefoo
+ def test_no_inspect(self):
+ class SomeFoo(TestFixture):
+ pass
+
+ assert_raises_message(
+ exc.NoInspectionAvailable,
+ "No inspection system is available for object of type ",
+ inspect, SomeFoo
+ )
+
def test_class_insp(self):
class SomeFoo(TestFixture):
pass