Ejemplo n.º 1
0
 def test_adding_config_to_existing_file(self):
     create_workflow_file_in_dir(self.test_cache_file_path)
     c = CF(working_directory=self.temp_dir)
     c.add_result('existingWorkflow', 'fileA', {'columnA': 'dataA'})
     c.add_config('existingWorkflow', 'fileA', {'hey': 'something'})
     self.assertIn('existingWorkflow', c.workflow_state[CF.RootKey])
     self.assertIn(
         'fileA',
         c.workflow_state[CF.RootKey]['existingWorkflow'][CF.FilesKey])
     self.assertEqual(
         'dataA', c.workflow_state[CF.RootKey]['existingWorkflow'][
             CF.FilesKey]['fileA'][CF.ResultsKey]['columnA'])
Ejemplo n.º 2
0
 def test_get_files_for_workflow(self):
     create_workflow_file_in_dir(self.test_cache_file_path)
     c = CF(working_directory=self.temp_dir)
     c.add_result('workflowA', 'fileA', {'columnA': 'dataA'})
     c.add_result('workflowA', 'fileB', {'columnA': 'dataB'})
     c.add_result('workflowF', 'fileA', {'columnA': 'dataC'})
     c.add_result('workflowF', 'fileQ', {'columnA': 'dataD'})
     files_in_workflow = c.get_files_for_workflow('workflowA')
     self.assertIsInstance(files_in_workflow, dict)
     self.assertEqual(2, len(files_in_workflow))
     self.assertListEqual(['fileA', 'fileB'],
                          list(files_in_workflow.keys()))