diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-01-11 22:43:27 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-01-11 22:43:27 +0000 |
| commit | b0a24149ffc4dd3b945b496e5cdb01111c8cf29a (patch) | |
| tree | da0d31fa9c46eb4e990c0df3dd116e8fa38dcd5c /repoze/bfg/tests/test_location.py | |
| parent | d69635eb6237055e8b3ccedeeaa7114a7beed057 (diff) | |
| download | pyramid-b0a24149ffc4dd3b945b496e5cdb01111c8cf29a.tar.gz pyramid-b0a24149ffc4dd3b945b496e5cdb01111c8cf29a.tar.bz2 pyramid-b0a24149ffc4dd3b945b496e5cdb01111c8cf29a.zip | |
- Improve test coverage.
- Remove old cold which attempts to recover from trying to unpickle a
``z3c.pt`` template; Chameleon has been the templating engine for a
good long time now. Running repoze.bfg against a sandbox that has
pickled ``z3c.pt`` templates it will now just fail with an
unpickling error, but can be fixed by deleting the template cache
files.
Diffstat (limited to 'repoze/bfg/tests/test_location.py')
| -rw-r--r-- | repoze/bfg/tests/test_location.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/repoze/bfg/tests/test_location.py b/repoze/bfg/tests/test_location.py index fc8f8c621..f297a9d6c 100644 --- a/repoze/bfg/tests/test_location.py +++ b/repoze/bfg/tests/test_location.py @@ -75,6 +75,28 @@ class TestLocation(unittest.TestCase): result = list(lineage(o1)) self.assertEqual(result, [o1]) +class TestClassAndInstanceDescr(unittest.TestCase): + def _getTargetClass(self): + from repoze.bfg.location import ClassAndInstanceDescr + return ClassAndInstanceDescr + + def _makeOne(self, *arg): + return self._getTargetClass()(*arg) + + def test__get__noinst(self): + def f(ob): + return ob + ob = self._makeOne(f, f) + result = ob.__get__(None, 1) + self.assertEqual(result, 1) + + def test__get__withinst(self): + def f(ob): + return ob + ob = self._makeOne(f, f) + result = ob.__get__(1, 2) + self.assertEqual(result, 1) + from repoze.bfg.interfaces import ILocation from zope.interface import implements class Location(object): |
