Пример #1
0
 def test_expire_option(self):
     # Assigning to the expire option raises a deprecation warning
     with check_warnings(("", ImminentDeprecationWarning)) as w:
         self.env.expire = True
     with check_warnings(("", ImminentDeprecationWarning)):
         self.env.config['expire'] = True
         # Reading the expire option raises a warning also.
     with check_warnings(("", ImminentDeprecationWarning)):
         x = self.env.expire
     with check_warnings(("", ImminentDeprecationWarning)):
         x = self.env.config['expire']
Пример #2
0
 def test_expire_option(self):
     # Assigning to the expire option raises a deprecation warning
     with check_warnings(("", ImminentDeprecationWarning)) as w:
         self.env.expire = True
     with check_warnings(("", ImminentDeprecationWarning)):
         self.env.config['expire'] = True
         # Reading the expire option raises a warning also.
     with check_warnings(("", ImminentDeprecationWarning)):
         x = self.env.expire
     with check_warnings(("", ImminentDeprecationWarning)):
         x = self.env.config['expire']
Пример #3
0
 def test_updater_option_passthrough(self):
     """Certain values of the "updater" option have been replaced with
     auto_build."""
     with check_warnings(("", ImminentDeprecationWarning)):
         self.env.auto_build = True
         self.env.updater = 'never'
         assert self.env.auto_build == False
Пример #4
0
 def test_updater_option_passthrough(self):
     """Certain values of the "updater" option have been replaced with
     auto_build."""
     with check_warnings(("", ImminentDeprecationWarning)):
         self.env.auto_build = True
         self.env.updater = 'never'
         assert self.env.auto_build == False
Пример #5
0
 def test_load_deprecated_attrs(self):
     with check_warnings(("", ImminentDeprecationWarning)) as w:
         environment = self.loader("""
         url: /foo
         directory: something
         expire: false
         """).load_environment()
         assert environment.url_expire == False
Пример #6
0
 def test_load_deprecated_attrs(self):
     with check_warnings(("", ImminentDeprecationWarning)) as w:
         environment = self.loader("""
         url: /foo
         directory: something
         expire: false
         """).load_environment()
         assert environment.url_expire == False
Пример #7
0
 def test_expire_option_passthrough(self):
     """While "expire" no longer exists, we attempt to provide an
     emulation."""
     with check_warnings(("", ImminentDeprecationWarning)):
         # Read
         self.env.url_expire = True
         assert self.env.expire == "querystring"
         # Write
         self.env.expire = False
         assert self.env.url_expire == False
         self.env.expire = "querystring"
         assert self.env.url_expire == True
         # "filename" needs to be migrated manually
         assert_raises(DeprecationWarning, setattr, self.env, "expire", "filename")
Пример #8
0
 def test_expire_option_passthrough(self):
     """While "expire" no longer exists, we attempt to provide an
     emulation."""
     with check_warnings(("", ImminentDeprecationWarning)):
         # Read
         self.env.url_expire = True
         assert self.env.expire == 'querystring'
         # Write
         self.env.expire = False
         assert self.env.url_expire == False
         self.env.expire = 'querystring'
         assert self.env.url_expire == True
         # "filename" needs to be migrated manually
         assert_raises(DeprecationWarning, setattr, self.env, 'expire', 'filename')