Beispiel #1
0
def test_printer_loading(hide_animation):
    p = Printer(hide_animation=hide_animation)
    print("\n")
    with p.loading("Loading..."):
        time.sleep(1)
    p.good("Success!")

    with p.loading("Something else..."):
        time.sleep(2)
    p.good("Yo!")

    with p.loading("Loading..."):
        time.sleep(1)
    p.good("Success!")
Beispiel #2
0
def test_printer_loading_no_print():
    p = Printer(no_print=True)
    with p.loading("Loading..."):
        time.sleep(1)
    p.good("Success!")
Beispiel #3
0
 def loading_with_exception():
     p = Printer()
     print("\n")
     with p.loading():
         raise Exception("This is an error.")