예제 #1
0
def test_url_constructor(fake_connection):
    connection = ShibaConnection("test", "test")
    action = "genericimportreport"
    ret = inf_constructor(connection, action, inf1="info1", inf2="info2")
    url = url_constructor(connection, ret)
    assert (url == "https://ws.priceminister.com/stock_ws?action=genericimportreport&inf1=info1&inf2=info2&login"
                   "=test&pwd=test&version=2011-11-29")
예제 #2
0
def test_url_constructor():
    connection = ShibaConnection("test", "test")
    action = "genericimportreport"
    ret = inf_constructor(connection, action, inf1="info1", inf2="info2")
    url = url_constructor(connection, ret)
    assert ("https://ws.fr.shopping.rakuten.com/stock_ws?action=genericimportreport&inf1=info1&inf2=info2&login=test&"
            "pwd=test&version=2017-02-10" == url)
예제 #3
0
def test_url_constructor_with_accent():
    connection = ShibaConnection("test", "test")
    action = "genericimportreport"
    ret = inf_constructor(connection, action, inf1=u"é", inf2=u"à")
    url = url_constructor(connection, ret)
    assert ("https://ws.fr.shopping.rakuten.com/stock_ws?action=genericimportreport&inf1=%C3%A9&inf2=%C3%A0&login=test&"
            "pwd=test&version=2017-02-10" == url)
예제 #4
0
def test_inf_constructor():
    connection = ShibaConnection("test", "test")
    action = "genericimportreport"
    ret = inf_constructor(connection, action, inf1="info1", inf2="info2")
    assert "inf1" in ret
    assert "inf2" in ret
    assert ret["inf1"] == "info1"
    assert ret["action"] == "genericimportreport"