- test_method.__name__ = "test_{0}".format(test_case["name"])
- if getattr(TestDownload, test_method.__name__, False):
- test_method.__name__ = "test_{0}_{1}".format(test_case["name"], n)
+ tname = 'test_' + str(test_case['name'])
+ i = 1
+ while hasattr(TestDownload, tname):
+ tname = 'test_' + str(test_case['name']) + '_' + str(i)
+ i += 1
+ test_method.__name__ = tname