def test_new_curl_command_list():
    """Test compare results for new curl command vs. requests using same interface."""
    url = "https://xkcd.com/552/info.0.json"
    curl_cmd = curl.get(url=url)
    curl_res = curl.execute(curl_cmd)
    reqs_res = requests.get(url=url)
    assert curl_res.ok == reqs_res.ok
    assert curl_res.content == reqs_res.content
Exemple #2
0
def test_curl_command_list():
    """Test building curl command as list."""
    cmd = curl.get(url="https://xkcd.com/552/info.0.json")
    assert cmd == [
        "curl",
        "--request",
        "GET",
        "https://xkcd.com/552/info.0.json",
    ]
Exemple #3
0
def test_curl_command_str():
    """Test building curl command as string."""
    cmd = curl.get(url="https://xkcd.com/552/info.0.json")
    assert (
        " ".join(cmd) == "curl --request GET https://xkcd.com/552/info.0.json")