예제 #1
0
 def setUp(self):
     super(TestEndToEnd, self).setUp()
     self.maxDiff = 20000
     self.client = client.Client()
     parser = self.client.parser()
     # Ensure that the client has an args attribute
     self.client.args = parser.parse_args(['file.yaml'])
예제 #2
0
    def _validate_args(self, args, filename, expected_filename=None):
        # path to fixture file
        fixture_path = self.get_fixture_path('mistral/' + filename)

        # run
        exit_status = client.Client().run(args + [fixture_path], self.stdout)
        self.assertEqual(exit_status, 0)

        # read expected data
        if not expected_filename:
            expected_filename = filename
        expected = self.get_fixture_content('orquesta/' + expected_filename)

        # compare
        self.stdout.seek(0)
        stdout = self.stdout.read()
        self.assertMultiLineEqual(stdout, expected)
예제 #3
0
 def setUp(self):
     super(TestClient, self).setUp()
     self.client = client.Client()
     self.maxDiff = 20000
    def setUp(self):
        super(PackClientRunTestCase, self).setUp()

        self.client = client.Client()
        self.pack_client = pack_client.PackClient()
예제 #5
0
                    # Move the backup file back
                    os.rename(a_f_backup, a_f)

                # If we ever support just Python 3, we can add the exception
                # directly to the dictionary value:
                #
                # .append({'file': m_f, 'exception': e})
                #
                exceptions.setdefault(str(e), []).append(m_f)
            else:
                # Remove the backup files
                os.remove(m_f_backup)
                os.remove(a_f_backup)

        if exceptions:
            sys.stderr.write(
                "ERROR: Unable to convert all Mistral workflows.\n")
            for e, wfs in exceptions.items():
                sys.stderr.write("ISSUE: {}\n".format(e))
                sys.stderr.write("Affected files:\n")
                for wf in wfs:
                    sys.stderr.write("  - {}\n".format(wf))
                sys.stderr.write("\n")

        return len(exceptions)


if __name__ == '__main__':
    sys.exit(PackClient().run(sys.argv[1:], sys.stdout,
                              client=client.Client()))