コード例 #1
0
 def test_nice_long_exception_message(self):
     val = str('a' * 500)
     with pytest.raises(AttributeError) as exc:
         Q.upper().foo.eval_(val)
     assert exc.value.args[0] == (
         "'str' object has no attribute 'foo'"
         "\n\n\tEncountered when evaluating <str instance>.foo")
コード例 #2
0
ファイル: test_soupy.py プロジェクト: asd1355215911/soupy
 def test_nice_long_exception_message(self):
     val = str('a' * 500)
     with pytest.raises(AttributeError) as exc:
         Q.upper().foo.eval_(val)
     assert exc.value.args[0] == (
         "'str' object has no attribute 'foo'"
         "\n\n\tEncountered when evaluating <str instance>.foo"
     )
コード例 #3
0
ファイル: test_soupy.py プロジェクト: asd1355215911/soupy
    def test_debug_method(self):
        with pytest.raises(AttributeError):
            Q.upper().foo.eval_('test')

        dbg = Q.debug_()
        assert isinstance(dbg, QDebug)
        assert repr(dbg.expr) == 'Q.upper().foo'
        assert repr(dbg.inner_expr) == '.foo'
        assert dbg.val == 'test'
        assert dbg.inner_val == 'TEST'
コード例 #4
0
    def test_debug_method(self):
        with pytest.raises(AttributeError):
            Q.upper().foo.eval_('test')

        dbg = Q.debug_()
        assert isinstance(dbg, QDebug)
        assert repr(dbg.expr) == 'Q.upper().foo'
        assert repr(dbg.inner_expr) == '.foo'
        assert dbg.val == 'test'
        assert dbg.inner_val == 'TEST'