def setup_method(self, method): self.ya = yaml_assistant.YamlAssistant() self.ya.role = 'creator' self.ya._files = { 'first': { 'source': 'f/g' }, 'second': { 'source': 's/t' } } self.tlh = TestLoggingHandler.create_fresh_handler() self.ya2 = yaml_assistant.YamlAssistant() self.ya2._files = {} self.ya2.role = 'creator' self.ya2._run = [{ 'if $ide': [{ 'if ls /notachance': [{ 'log_d': 'ifif' }] }, { 'else': [{ 'log_d': 'ifelse' }] }] }, { 'else': [{ 'log_d': 'else' }] }]
def test_loop_two_control_vars(self, iter_type): # this should work the same for both iteration types tlh = TestLoggingHandler.create_fresh_handler() run_section([{'for $i, $j {0} $foo'.format(iter_type): [{'log_i': '$i, $j'}]}], {'foo': {'bar': 'barval', 'spam': 'spamval'}}) assert ('INFO', 'bar, barval') in tlh.msgs assert ('INFO', 'spam, spamval') in tlh.msgs
def setup_method(self, method): self.ya = yaml_assistant.YamlAssistant('ya', {}, '', None) self.ya.role = 'crt' self.ya._files = {'first': {'source': 'f/g'}, 'second': {'source': 's/t'}} self.ya._dependencies = [{'rpm': ['foo']}] self.ya._dependencies_a = [{'rpm': ['bar']}] self.ya._pre_run = [{'log_i': 'pre'}] self.ya._run = [{'log_i': 'run'}] self.ya._post_run = [{'log_i': 'post'}] self.tlh = TestLoggingHandler.create_fresh_handler()
def test_loop_two_control_vars(self): tlh = TestLoggingHandler.create_fresh_handler() run_section([{ 'for $i, $j in $foo': [{ 'log_i': '$i, $j' }] }], {'foo': { 'bar': 'barval', 'spam': 'spamval' }}) assert ('INFO', 'bar, barval') in tlh.msgs assert ('INFO', 'spam, spamval') in tlh.msgs
def setup_method(self, method): self.ya = yaml_assistant.YamlAssistant('ya', {}, '') self.ya.role = 'creator' self.ya._files = {'first': {'source': 'f/g'}, 'second': {'source': 's/t'}} self.tlh = TestLoggingHandler.create_fresh_handler() self.ya2 = yaml_assistant.YamlAssistant('ya2', {}, '') self.ya2._files = {} self.ya2.role = 'creator' self.ya2._run = [{'if $ide': [{'if $(test -d /notachance)': [{'log_d': 'ifif'}]}, {'else': [{'log_d': 'ifelse'}]}]}, {'else': [{'log_d': 'else'}]}]
def test_loop_two_control_vars(self, iter_type): # this should work the same for both iteration types tlh = TestLoggingHandler.create_fresh_handler() run_section([{ 'for $i, $j {0} $foo'.format(iter_type): [{ 'log_i': '$i, $j' }] }], {'foo': { 'bar': 'barval', 'spam': 'spamval' }}) assert ('INFO', 'bar, barval') in tlh.msgs assert ('INFO', 'spam, spamval') in tlh.msgs
def setup_method(self, method): if os.path.exists(self.cf): os.unlink(self.cf) self.cch = Cache() self.tlh = TestLoggingHandler.create_fresh_handler()
def setup_method(self, method): self.yl = YamlAssistantLoader self.reset_yl_assistants_dirs() self.tlh = TestLoggingHandler.create_fresh_handler()
def setup_method(self, method): self.tlh = TestLoggingHandler.create_fresh_handler()
def setup_method(self, method): self.da = actions.DocAction self.tlh = TestLoggingHandler.create_fresh_handler()
def setup_method(self, method): self.old_command_runners = command_runners.command_runners command_runners.command_runners = copy.deepcopy(self.old_command_runners) self.tlh = TestLoggingHandler.create_fresh_handler()
def setup_method(self, method): self.ya = yaml_assistant.YamlAssistant() self.ya.role = 'modifier' self.ya._files = {} self.tlh = TestLoggingHandler.create_fresh_handler() self.dda = {'subassistant_path': ['foo', 'bar', 'baz']}
def setup_method(self, method): self.tlh = TestLoggingHandler() self.oldinp = CliDialogHelper.inp
def setup_method(self, method): self.ya = yaml_assistant.YamlAssistant('ya', {}, '') self.ya.role = 'modifier' self.ya._files = {} self.tlh = TestLoggingHandler.create_fresh_handler() self.dda = {'subassistant_path': ['foo', 'bar', 'baz']}
def setup_method(self, method): self.l = LogCommandRunner self.tlh = TestLoggingHandler.create_fresh_handler()
def setup_method(self, method): self.ya = yaml_assistant.YamlAssistant('ya', {}, '', None) self.ya.role = 'mod' self.ya._files = {} self.tlh = TestLoggingHandler.create_fresh_handler() self.dda = {'project_type': ['foo', 'bar', 'baz']}
def setup_method(self, method): self.ya = yaml_assistant.YamlAssistant('ya', {}, '', None) self.ya.role = 'twk' self.ya._files = {} self.tlh = TestLoggingHandler.create_fresh_handler() self.dda = {'project_type': ['foo', 'bar', 'baz']}
def setup_method(self, method): self.tlh = TestLoggingHandler()
def test_loop_two_control_vars(self): tlh = TestLoggingHandler.create_fresh_handler() run_section([{'for $i, $j in $foo': [{'log_i': '$i, $j'}]}], {'foo': {'bar': 'barval', 'spam': 'spamval'}}) assert ('INFO', 'bar, barval') in tlh.msgs assert ('INFO', 'spam, spamval') in tlh.msgs