コード例 #1
0
ファイル: test_environment.py プロジェクト: tilgovi/webassets
 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
ファイル: test_environment.py プロジェクト: njoyce/webassets
 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
ファイル: test_environment.py プロジェクト: njoyce/webassets
 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
ファイル: test_environment.py プロジェクト: tilgovi/webassets
 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
ファイル: test_loaders.py プロジェクト: RealKinetic/webassets
 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
ファイル: test_config.py プロジェクト: hllau/flask-assets
 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')