mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-22 08:50:13 +08:00
change: make locusts as hrun sub-command, usage: hrun locusts -h
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
config:
|
||||
name: create users with uid
|
||||
variables:
|
||||
device_sn: ${gen_random_string(15)}
|
||||
base_url: "http://127.0.0.1:5000"
|
||||
|
||||
testcases:
|
||||
-
|
||||
name: create user 1000 and check result.
|
||||
testcase: testcases/create_user.yml
|
||||
weight: 2
|
||||
variables:
|
||||
uid: 1000
|
||||
|
||||
-
|
||||
name: create user 1001 and check result.
|
||||
testcase: testcases/create_user.yml
|
||||
weight: 3
|
||||
variables:
|
||||
uid: 1001
|
||||
@@ -1,19 +0,0 @@
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from httprunner.ext.locusts.utils import prepare_locust_tests
|
||||
|
||||
|
||||
class TestLocust(unittest.TestCase):
|
||||
|
||||
def test_prepare_locust_tests(self):
|
||||
path = os.path.join(
|
||||
os.getcwd(), 'tests/locust_tests/demo_locusts.yml')
|
||||
locust_tests = prepare_locust_tests(path)
|
||||
self.assertEqual(len(locust_tests), 2 + 3)
|
||||
name_list = [
|
||||
"create user 1000 and check result.",
|
||||
"create user 1001 and check result."
|
||||
]
|
||||
self.assertIn(locust_tests[0]["config"]["name"], name_list)
|
||||
self.assertIn(locust_tests[4]["config"]["name"], name_list)
|
||||
Reference in New Issue
Block a user