Exemplo n.º 1
0
def test_etree_general_parse_with_encoding(fromstring):
    mock = Mock()
    etree = ElementTreeProperty(text_response_attr="foo", encoding="utf-8")
    etree.provide_value(mock)
    fromstring.assert_called_once_with(mock.foo.encode("utf-8"))
Exemplo n.º 2
0
def test_etree_general(fromstring):
    mock = Mock()
    etree = ElementTreeProperty(text_response_attr="foo")
    etree.provide_value(mock)
    fromstring.assert_called_once_with(mock.foo)
Exemplo n.º 3
0
def test_etree_general_parse_with_default(fromstring):
    mock = Mock()
    etree = ElementTreeProperty()
    etree.provide_value(mock)
    fromstring.assert_called_once_with(mock.text_response)
Exemplo n.º 4
0
def test_etree_general_parse_with_encoding(fromstring):
    mock = Mock()
    etree = ElementTreeProperty(text_response_attr="foo", encoding="utf-8")
    etree.provide_value(mock)
    fromstring.assert_called_once_with(mock.foo.encode("utf-8"))
Exemplo n.º 5
0
def test_etree_general(fromstring):
    mock = Mock()
    etree = ElementTreeProperty(text_response_attr="foo")
    etree.provide_value(mock)
    fromstring.assert_called_once_with(mock.foo)
Exemplo n.º 6
0
def test_etree_general_parse_with_default(fromstring):
    mock = Mock()
    etree = ElementTreeProperty()
    etree.provide_value(mock)
    fromstring.assert_called_once_with(mock.text_response)