示例#1
0
    def test_run_base_class(self):
        """Verify that it is impossible to run, submit or instantiate a base `CalcJob` class."""
        with self.assertRaises(exceptions.InvalidOperation):
            CalcJob()

        with self.assertRaises(exceptions.InvalidOperation):
            launch.run(CalcJob)

        with self.assertRaises(exceptions.InvalidOperation):
            launch.run_get_node(CalcJob)

        with self.assertRaises(exceptions.InvalidOperation):
            launch.run_get_pk(CalcJob)

        with self.assertRaises(exceptions.InvalidOperation):
            launch.submit(CalcJob)
示例#2
0
 def test_spec_options_property(self):
     """`CalcJob.spec_options` should return the options port namespace of its spec."""
     self.assertIsInstance(CalcJob.spec_options, PortNamespace)
     self.assertEqual(CalcJob.spec_options,
                      CalcJob.spec().inputs['metadata']['options'])