def test_it_should_start_server(self):
     with smtp_server() as server:
         assert_that(server.accepting, is_(True))
    def test_it_should_stop_server(self):
        with smtp_server() as server:
            pass

        time.sleep(0.02)  # wait for the server to finish
        assert_that(server.is_alive(), is_(False))
 def test_it_should_give_a_server(self):
     with smtp_server() as server:
         assert_that(server, is_(instance_of(SmtpServer)))