def test_build_uses_context(self, mock_load, mock_rat): class args: filename = 'filename.yml' ctx = ['a=b'] mock_rat.return_value = None WharfRat.build(args) _, kwargs = mock_rat.call_args self.assertEqual(kwargs['context'], {'a': 'b'})
def test_alternate_file(self, mock_load): with open('filename.yml', 'w') as f: f.write(''' front: type: instance image: busybox basic: type: task images: - front - back ''') class args: filename = 'filename.yml' WharfRat.build(args) mock_load.assert_called_with('filename.yml')
def main(args=None): parser = create_parser() _args = parser.parse_args(args) translater = WharfRat.build(_args) command = get_command(_args) result = command(translater, _args.task) for item in result: issue(item)
def test_alternate_file(self, mock_load): class args: filename = 'filename.yml' WharfRat.build(args) mock_load.assert_called_with('filename.yml')
def test_reads_file(self, mock_load): class args: filename = None WharfRat.build(args) mock_load.assert_called_with('wharfrat.yml')