summaryrefslogtreecommitdiff
path: root/pyramid/tests/test_configuration.py
blob: 0a98bcb5c9827c1b6e31163fc78ff57443cf0692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import unittest

class ConfiguratorTests(unittest.TestCase):
    def setUp(self):
        from zope.deprecation import __show__
        __show__.off()

    def tearDown(self):
        from zope.deprecation import __show__
        __show__.on()
        
    def _makeOne(self, *arg, **kw):
        from pyramid.configuration import Configurator
        return Configurator(*arg, **kw)

    def test_autocommit_true(self):
        config = self._makeOne()
        self.assertEqual(config.autocommit, True)
        
    def test_package_is_not_None(self):
        import pyramid
        config = self._makeOne(package='pyramid')
        self.assertEqual(config.package, pyramid)

    def test_with_package(self):
        import pyramid
        config = self._makeOne()
        newconfig = config.with_package('pyramid')
        self.assertEqual(newconfig.package, pyramid)