def test_default_app(self): run = self.build_run() handler = runcontainer.Command() expected_command = [ 'singularity', 'run', '--contain', '--cleanenv', '-B', '/tmp/box23/input:/mnt/input,/tmp/box23/output:/mnt/output', '/tmp/foo.simg', '/mnt/input/in_csv', '/mnt/output/out_csv' ] command = handler.build_command(run) self.assertListEqual(expected_command, command)
def test_build_dataset_name(self): run = ContainerRun(id=42) handler = runcontainer.Command() scenarios = [('example_csv', 'example_42.csv'), ('example_tar_gz', 'example_42.tar.gz'), ('csv', '42.csv'), ('_csv', '_42.csv'), ('_', '__42'), ('no_extension', 'no_extension_42')] for argument_name, expected_dataset_name in scenarios: dataset_name = handler.build_dataset_name(run, argument_name) self.assertEqual(expected_dataset_name, dataset_name)