Ejemplo n.º 1
0
    def test_5_multiple_transactions(self):
        with transaction("Transaction 1"):
            target.get('/')
            target.get('/2')

        with transaction("Transaction 2"):
            target.get('/')
            target.get('/2')
    def test_requests(self):
        with apibase.transaction('blazedemo 123'):
            response = apibase.http.get('http://demo.blazemeter.com/echo.php?echo=123', allow_redirects=True)
            response.assert_jsonpath('$.GET.echo', expected_value='123')
        time.sleep(0.75)

        with apibase.transaction('blazedemo 456'):
            response = apibase.http.get('http://demo.blazemeter.com/echo.php?echo=456', allow_redirects=True)
            response.assert_jsonpath("$['GET']['echo']", expected_value='456789')
        time.sleep(0.75)
Ejemplo n.º 3
0
 def test_8_transaction_attach(self):
     with transaction("Label") as tran:
         user_input = "YO"
         tran.set_request("Request body")
         tran.set_response("Response body")
         tran.set_response_code(201)
         tran.attach_extra("user", user_input)
Ejemplo n.º 4
0
 def test_7_transaction_fail(self):
     with transaction("Label") as tran:
         tran.fail("Something went wrong")
Ejemplo n.º 5
0
 def test_6_transaction_obj(self):
     tran = transaction("Label")
     tran.start()
     time.sleep(0.5)
     tran.finish()
Ejemplo n.º 6
0
 def test_4_mixed_transaction(self):
     target.get('/')
     with transaction("Transaction"):
         target.get('/2')
Ejemplo n.º 7
0
 def test_3_toplevel_transaction(self):
     with transaction("Transaction"):
         target.get('/')
         target.get('/2')
 def test_case1(self):
     #apibase.http.get("http://localhost:8003")
     with apibase.transaction("tran name"):
         for x in range(1000, 10000):
             y = math.sqrt(x)
Ejemplo n.º 9
0
 def test_1_single_transaction(self):
     with apibase.transaction("single-transaction"):
         pass
Ejemplo n.º 10
0
 def test_3_nested_transactions(self):
     with apibase.transaction("outer"):
         with apibase.transaction("inner"):
             pass
Ejemplo n.º 11
0
 def test_2_two_transactions(self):
     with apibase.transaction("transaction-1"):
         pass
     with apibase.transaction("transaction-2"):
         pass