Define the operations in the class, not in the function

I was originally going to try to automatically include these in the docstring
using format, but they would have to be defined before the docstring for that
to work. But I think it's still useful to have these defined in the class.
This commit is contained in:
Aaron Meurer
2013-07-28 14:31:47 -05:00
parent 78f7ff6760
commit ae09a2d0a4

View File

@@ -87,12 +87,13 @@ class TestCase(object):
dct = json.load(f)
return cls(**dct)
operations = [
'completions', 'goto_assignments', 'goto_definitions', 'usages',
'call_signatures']
@classmethod
def generate(cls, file_path):
operations = [
'completions', 'goto_assignments', 'goto_definitions', 'usages',
'call_signatures']
operation = random.choice(operations)
operation = random.choice(cls.operations)
path = random.choice(SourceFinder.files(file_path))
with open(path) as f: