def __init__(self, manuscript, timedelay): self.timedelay = timedelay self.popup = None self.execution_started = False self.windows = [] self.instructions = [] for line in [ line for line in manuscript.get_instructions() if not line.startswith("#") and len(line.strip()) > 0 ]: try: instruction = parse(line) except Exception: Logger.add_error("Can't parse instruction: '%s'" % line) raise if instruction is not None: self.instructions.append(instruction) collector = [] for instruction in self.instructions: collector.append(instruction.to_unicode()) Logger.header("Effective Instructions:\n %s" % "\n ".join(collector))
def setUp(self): self.instruction = parse("click button (OK|Cancel)") self.win = Win() self.manuscript = Mock() self.manuscript.execute_next_instruction.return_value = None
def do_parse(self, text): self.instruction = parse(text)
def test_single_quoted_string(self): instruction = parse("enter text(1, 'Roger')") self.assertEquals("enter text(1,'Roger')", "%s" % instruction)