예제 #1
0
def test_delete_image() -> None:

    from sxcu import SXCU

    time.sleep(60)  # to prevent overloading server
    t = SXCU()
    con = t.upload_image(file=img_loc, noembed=True)
    a = SXCU.delete_image(con["del_url"])
    assert a is True
예제 #2
0
def test_upload_keys_default_domain_and_delete_image() -> None:
    time.sleep(60)

    _t = SXCU()
    con = _t.upload_file(file=IMG_LOC)
    expected_keys = ["url", "del_url", "thumb"]
    assert (list(con.keys()).sort() == expected_keys.sort()
            )  # sorting because keys are arraged different

    _a = SXCU.delete_image(con["del_url"])
    assert _a is True