122
122
class TestRequestWorker(tests.TestCaseWithTransport):
125
super(TestRequestWorker, self).setUp()
126
126
self.transport_readonly_server = http_server.HttpServer
128
128
def test_request_items(self):
278
278
class TestActionScriptIntegration(tests.TestCaseWithTransport):
281
super(TestActionScriptIntegration, self).setUp()
282
282
self.transport_readonly_server = http_server.HttpServer
284
284
def test_full_integration(self):
285
285
self.build_tree(['first', 'second', 'third', 'fourth'])
286
286
url = self.get_readonly_url()
287
script = load_test.ActionScript.parse("""{
288
"parameters": {"base_url": "%s", "blocking_timeout": 2.0},
287
script = load_test.ActionScript.parse("""{{
288
"parameters": {{"base_url": "{}", "blocking_timeout": 2.0}},
290
{"thread": "1", "relpath": "first"},
291
{"thread": "2", "relpath": "second"},
292
{"thread": "1", "relpath": "no-this"},
293
{"thread": "2", "relpath": "or-this"},
294
{"thread": "1", "relpath": "third"},
295
{"thread": "2", "relpath": "fourth"}
290
{{"thread": "1", "relpath": "first"}},
291
{{"thread": "2", "relpath": "second"}},
292
{{"thread": "1", "relpath": "no-this"}},
293
{{"thread": "2", "relpath": "or-this"}},
294
{{"thread": "1", "relpath": "third"}},
295
{{"thread": "2", "relpath": "fourth"}}
298
298
worker = script._get_worker("1")
299
299
self.assertEqual([("first", True), ('no-this', False),
310
310
class TestRunScript(tests.TestCaseWithTransport):
313
super(TestRunScript, self).setUp()
314
314
self.transport_readonly_server = http_server.HttpServer
316
316
def test_run_script(self):
317
317
self.build_tree(['file1', 'file2', 'file3', 'file4'])
318
318
url = self.get_readonly_url()
319
self.build_tree_contents([('localhost.script', """{
320
"parameters": {"base_url": "%s", "blocking_timeout": 0.1},
319
self.build_tree_contents([('localhost.script', """{{
320
"parameters": {{"base_url": "{}", "blocking_timeout": 0.1}},
322
{"thread": "1", "relpath": "file1"},
323
{"thread": "2", "relpath": "file2"},
324
{"thread": "1", "relpath": "file3"},
325
{"thread": "2", "relpath": "file4"}
322
{{"thread": "1", "relpath": "file1"}},
323
{{"thread": "2", "relpath": "file2"}},
324
{{"thread": "1", "relpath": "file3"}},
325
{{"thread": "2", "relpath": "file4"}}
328
328
script = load_test.run_script('localhost.script')
329
329
worker = script._threads["1"][0]
330
330
self.assertEqual([("file1", True), ('file3', True)],