This commit is contained in:
Alexey Lavrenuke (load testing) 2014-02-20 18:51:57 +04:00
parent 76a3084f12
commit 3b24d0abcd
2 changed files with 12 additions and 9 deletions

View File

@ -249,6 +249,9 @@ class UriReader(object):
headers=self.headers,
http_ver=self.http_ver,
).to_s(), marker)
if info.status.ammo_count == 0:
self.log.error("No ammo in uri-style file")
raise AmmoFileError("No ammo! Cover me!")
ammo_file.seek(0)
info.status.af_position = 0
info.status.inc_loop_count()

View File

@ -147,12 +147,12 @@ class StepperTestCase(TankTestCase):
from Tank.stepper.module_exceptions import AmmoFileError
temp_stpd = tempfile.mkstemp()[1]
with open(temp_stpd, 'w') as stpd_file:
Stepper(
rps_schedule=[],
instances_schedule=[],
loop_limit=-1,
ammo_limit=10,
headers=[],
ammo_file="data/empty.uri",
).write(stpd_file)
self.assertRaises(AmmoFileError)
with self.assertRaises(AmmoFileError):
Stepper(
rps_schedule=[],
instances_schedule=[],
loop_limit=-1,
ammo_limit=10,
headers=[],
ammo_file="data/empty.uri",
).write(stpd_file)