def test_script_parse(self): """ Test to ensure a basic outline script parses. """ path = "scripts/shell.outline" ol = outline.load_outline(path) # check to ensure the loader returns the correct type. self.assertTrue(isinstance(ol,outline.Outline)) # Ensure the path is the same self.assertEquals(path, ol.get_path()) # Ensure the single event has been loaded self.assertEquals(1, len(ol.get_layers())) # ensure that outline returned from load_outline is # the same as current_outline self.assertEquals(ol, outline.current_outline())
def testLaunchAndTest(self, launchSpecAndWaitMock, getStubMock, getJobMock): jobName = 'another-job' launchSpecAndWaitMock.return_value = [ opencue.wrappers.job.Job( opencue.compiled_proto.job_pb2.Job(name=jobName)) ] getJobMock.return_value = opencue.wrappers.job.Job( opencue.compiled_proto.job_pb2.Job( name=jobName, state=opencue.api.job_pb2.FINISHED)) path = os.path.join(SCRIPTS_DIR, 'shell.outline') ol = outline.load_outline(path) launcher = outline.cuerun.OutlineLauncher(ol, user=TEST_USER) launcher.set_flag('test', True) serializedXml = launcher.serialize(use_pycuerun=True) outline.backend.cue.launch(launcher) launchSpecAndWaitMock.assert_called_with(serializedXml)
def testLaunchAndWait(self, launchSpecAndWaitMock, getStubMock, isJobPendingMock): jobName = 'some-job' launchSpecAndWaitMock.return_value = [ opencue.wrappers.job.Job( opencue.compiled_proto.job_pb2.Job(name=jobName)) ] # Trigger one iteration of the wait loop. isJobPendingMock.side_effect = [True, False] path = os.path.join(SCRIPTS_DIR, 'shell.outline') ol = outline.load_outline(path) launcher = outline.cuerun.OutlineLauncher(ol, user=TEST_USER) launcher.set_flag('wait', True) serializedXml = launcher.serialize(use_pycuerun=True) outline.backend.cue.launch(launcher) launchSpecAndWaitMock.assert_called_with(serializedXml) isJobPendingMock.assert_has_calls( [mock.call(jobName), mock.call(jobName)])
def test_serialized_parse(self): """ Test to ensure a serialized outline parses. """ ## Yaml likes to have the full path or else it refuses to parse. path = "./scripts/yamlized.yaml" ol = outline.load_outline(path) # check to ensure the loader returns the correct type. self.assertTrue(isinstance(ol,outline.Outline)) # Ensure the path is the same self.assertEquals(path, ol.get_path()) # Ensure the single event has been loaded self.assertEquals(1, len(ol.get_layers())) # ensure that outline returned from load_outline is # the same as current_outline self.assertEquals(ol, outline.current_outline())
def test_serialized_parse(self): """ Test to ensure a serialized outline parses. """ filename = 'yamlized.yaml' pathOnDisk = os.path.join(SCRIPTS_DIR, filename) pathInYaml = './scripts/' + filename ol = outline.load_outline(pathOnDisk) # check to ensure the loader returns the correct type. self.assertTrue(isinstance(ol, outline.Outline)) # Ensure the path is the same self.assertEqual(pathInYaml, ol.get_path()) # Ensure the single event has been loaded self.assertEqual(1, len(ol.get_layers())) # ensure that outline returned from load_outline is # the same as current_outline self.assertEqual(ol, outline.current_outline())
def test_is_layer(self): with test_utils.TemporarySessionDirectory(): ol = outline.load_outline(self.path) self.assertTrue(ol.is_layer("cmd")) self.assertFalse(ol.is_layer("not_a_layer"))
def test_get_layers(self): with test_utils.TemporarySessionDirectory(): ol = outline.load_outline(self.path) self.assertEqual(1, len(ol.get_layers())) self.assertTrue(isinstance(ol.get_layers(), list))
def setUp(self): path = os.path.join(SCRIPTS_DIR, 'shell.outline') self.ol = outline.load_outline(path) self.launcher = outline.cuerun.OutlineLauncher(self.ol, user=TEST_USER) self.layer = self.ol.get_layer('cmd')
def setUp(self): self.ol = outline.load_outline( os.path.join(SCRIPTS_DIR, 'shell.outline'))
def setUp(self): path = os.path.join(SCRIPTS_DIR, 'shell.outline') self.ol = outline.load_outline(path) self.launcher = outline.cuerun.OutlineLauncher(self.ol)
def setUp(self): """Setup a basis event from a preset outline file.""" path = "scripts/shell.outline" self.ol = outline.load_outline(path) self.ol.set_frame_range("1-10") self.event = self.ol.get_layer("cmd")
def setUp(self): path = "scripts/shell.outline" self.ol = outline.load_outline(path) self.ol.set_frame_range("1-10") self.ol.setup() self.session = self.ol.get_session()
def setUp(self): self.ol = outline.load_outline(os.path.join(SCRIPTS_DIR, 'shell.outline')) self.ol.set_frame_range("1-10") self.event = self.ol.get_layer("cmd") self.event.set_chunk_size(5)
def setUp(self): self.script_path = os.path.join(SCRIPTS_DIR, 'shell.outline') self.ol = outline.load_outline(self.script_path) self.ol.set_frame_range("1-10") self.ol.setup() self.session = self.ol.get_session()
def setUp(self): """Setup a basis event from a preset outline file.""" path = os.path.join(SCRIPTS_DIR, 'shell.outline') self.ol = outline.load_outline(path) self.ol.set_frame_range('1-10') self.event = self.ol.get_layer('cmd')
def setUp(self): self.path = "scripts/shell.outline" self.ol = outline.load_outline(self.path)