def integration_test(): with StaticPyPiServer(): with LiveServer() as liveserver: versions_page = download(liveserver.url + "simple/yadt/") assert_that(versions_page).contains("0.1.2").contains( "1.2.3").contains("2.3.4")
def integration_test(): with StaticPyPiServer(): with LiveServer() as liveserver: actual_content = download(liveserver.url + "package/yadt/1.2.3/yadt-1.2.3.tar.gz") assert_that(actual_content).is_equal_to("static content")
def integration_test_with_cached_file(): with StaticPyPiServer(): with LiveServer() as liveserver: liveserver.create_cached_file("yadt-5.4.3.tar.gz") versions_page = download(liveserver.url + "simple/yadt/") assert_that(versions_page).contains("0.1.2").contains( "1.2.3").contains("2.3.4").does_not_contain("5.4.3")
def integration_test_with_cached_file(): with StaticPyPiServer(): with LiveServer() as liveserver: liveserver.create_cached_file("yadt-1.2.3.tar.gz") actual_content = download(liveserver.url + "package/yadt/1.2.3/yadt-1.2.3.tar.gz") assert_that(actual_content).is_equal_to("cached content")
def integration_test(): with StaticPyPiServer(): with LiveServer() as liveserver: liveserver.create_hosted_file("yadt-1.2.3.tar.gz") index_page = download(liveserver.url + "simple/") assert_that(index_page).starts_with("<!doctype html>\n<html>") \ .contains("<h1>List of Packages</h1>") \ .contains("<a href=\"/simple/public-a\">public-a</a><br/>") \ .contains("<a href=\"/simple/public-b\">public-b</a><br/>") \ .contains("<a href=\"/simple/public-c\">public-c</a><br/>") \ .contains("<a href=\"/simple/yadt\">yadt</a><br/>") \ .ends_with("</html>")