def test_start_stop(self): self.assertEqual( str(Command.start_stop('abracadabra', 0, 5, 'shazam')), str([ Command('start_abracadabra', 0, 'shazam'), Command('stop_abracadabra', 5, 'shazam'), ]))
def build_commands(self, block): """ Build all of the manipulation commands for a given block. - One pair to set the text. - Multiple pairs for styles. - Multiple pairs for entities. """ text_commands = Command.start_stop('text', 0, len(block.get('text'))) style_commands = self.build_style_commands(block) entity_commands = self.build_entity_commands(block) return text_commands + style_commands + entity_commands
def build_commands(self, block): """ Build all of the manipulation commands for a given block. - One pair to set the text. - Multiple pairs for styles. - Multiple pairs for entities. """ text_commands = Command.start_stop('text', 0, len(block['text'])) style_commands = self.build_style_commands(block) entity_commands = self.build_entity_commands(block) return text_commands + style_commands + entity_commands
def test_start_stop(self): self.assertEqual(str(Command.start_stop('abracadabra', 0, 5, 'shazam')), str([ Command('start_abracadabra', 0, 'shazam'), Command('stop_abracadabra', 5, 'shazam'), ]))