feat: make locusts as httprunner plugin

This commit is contained in:
debugtalk
2019-10-25 16:40:47 +08:00
parent 890f2796c0
commit 22eb592eec
10 changed files with 158 additions and 54 deletions

View File

View File

@@ -0,0 +1,19 @@
import os
import unittest
from httprunner.plugins.locusts 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)