Esempio 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"))
Esempio 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)
Esempio 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)
Esempio 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"))
Esempio 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)
Esempio 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)