コード例 #1
0
ファイル: test_browser.py プロジェクト: thiagocaiubi/splinter
 def test_should_deprecate_with_the_given_message(self):
     from splinter.browser import deprecate
     with warnings.catch_warnings(record=True) as warnings_list:
         warnings.simplefilter('default')
         cls = deprecate(self.Foo, message="Foo was deprecated")
         cls()
         warning = warnings_list[0]
         assert type(warning.message) is DeprecationWarning
         assert_equals("Foo was deprecated", warning.message.args[0])
コード例 #2
0
ファイル: test_browser.py プロジェクト: thiagocaiubi/splinter
 def test_should_prepend_a_Deprecated_to_class(self):
     from splinter.browser import deprecate
     with warnings.catch_warnings(record=True):
         warnings.simplefilter('default')
         cls = deprecate(self.Foo, message="Foo was deprecated")
         assert_equals("DeprecatedFoo", cls.__name__)