Beispiel #1
0
 def test_files_without_replacement(self):
     files = {'foo': 'bar'}
     expected = {
         k: os.path.join(self.properties['output_directory'], v)
         for k, v in files.items()
     }
     with mock.patch.object(Singularity, 'FILES', files):
         s = Singularity(None, None)
         result = s.get_output_file_list()
     self.assertEqual(result, expected)
Beispiel #2
0
 def test_files_with_prefix_added(self):
     files = {'foo': '{PREFIX}.bar'}
     expected = {
         k: os.path.join(self.properties['output_directory'],
                         v.format(PREFIX=self.properties['prefix']))
         for k, v in files.items()
     }
     with mock.patch.object(Singularity, 'FILES', files):
         s = Singularity(None, None)
         result = s.get_output_file_list()
     self.assertEqual(result, expected)
Beispiel #3
0
 def test_error_on_files_with_non_prefix_format_string(self):
     files = {'foo': '{bar}.bar'}
     with mock.patch.object(Singularity, 'FILES', files):
         s = Singularity(None, None)
         with self.assertRaises(KeyError):
             result = s.get_output_file_list()