fix locust in testsuite

This commit is contained in:
debugtalk
2018-12-21 20:48:55 +08:00
parent 2f445135e9
commit e507e69e89
4 changed files with 48 additions and 12 deletions

View File

@@ -598,3 +598,12 @@ class TestLocust(unittest.TestCase):
self.assertEqual(len(locust_tests["tests"]), 10)
self.assertEqual(locust_tests["tests"][0]["name"], "index")
self.assertEqual(locust_tests["tests"][9]["name"], "user-agent")
def test_prepare_locust_tests_with_layer(self):
path = os.path.join(
os.getcwd(), 'tests/locust_tests/demo_locust_with_layer.yml')
locust_tests = prepare_locust_tests(path)
self.assertIn("gen_md5", locust_tests["functions"])
self.assertEqual(len(locust_tests["tests"]), 4 * 2 + 4 * 3)
self.assertIn("setup and reset all (override)", locust_tests["tests"][0]["config"]["name"])
self.assertIn("check if user ", locust_tests["tests"][19]["name"])