From ae09a2d0a497ce569c48e56db9ce6200ee4b3ccf Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Sun, 28 Jul 2013 14:31:47 -0500 Subject: [PATCH] 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. --- sith.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sith.py b/sith.py index 2cbf4122..eabf5179 100755 --- a/sith.py +++ b/sith.py @@ -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: