def test_nohtml(string, expected, expected_quoted): result = lang.nohtml(string) assert isinstance(result, str) assert isinstance(result, lang.NoHtml) assert result == expected quoted = lang.quote(result) assert isinstance(quoted, str) assert quoted == expected_quoted
def test_nohtml_invalid(py2): match = r"required types.+'str'" if py2: match += r".+'unicode'" with pytest.raises(TypeError, match=match): nohtml(True)
def test_nohtml(string): result = nohtml(string) assert result == string assert isinstance(result, type(string))
def test_nohtml_invalid(py2): match = r"required types.+'str'" if py2: match += r".+'unicode'" with pytest.raises(TypeError, match=match): nohtml(True)
def test_nohtml(py2): assert nohtml('spam') == 'spam' assert isinstance(nohtml('spam'), str) assert nohtml(u'spam') == u'spam' assert isinstance(nohtml(u'spam'), unicode if py2 else str)
def test_nohtml(string='spam'): result = nohtml(string) assert result == string assert isinstance(result, str)