15531: Federation migrate script wip
[arvados.git] / sdk / cwl / tests / test_container.py
index c270b9d383b9231f14098d2e861b35a78f162a39..3374e1c13f8004100c2f3c114edbfba2db26dec6 100644 (file)
@@ -56,6 +56,9 @@ class CollectionMock(object):
 
 class TestContainer(unittest.TestCase):
 
+    def setUp(self):
+        cwltool.process._names = set()
+
     def helper(self, runner, enable_reuse=True):
         document_loader, avsc_names, schema_metadata, metaschema_loader = cwltool.process.get_schema("v1.1")
 
@@ -85,7 +88,6 @@ class TestContainer(unittest.TestCase):
     def setup_and_test_container_executor_and_logging(self, gcc_mock) :
         api = mock.MagicMock()
         api._rootDesc = copy.deepcopy(get_rootDesc())
-        del api._rootDesc.get('resources')['jobs']['methods']['create']
 
         # Make sure ArvCwlExecutor thinks it's running inside a container so it
         # adds the logging handler that will call runtime_status_update() mock
@@ -324,7 +326,7 @@ class TestContainer(unittest.TestCase):
         call_args, call_kwargs = runner.api.container_requests().create.call_args
 
         vwdmock.copy.assert_has_calls([mock.call('bar', 'foo', source_collection=sourcemock)])
-        vwdmock.copy.assert_has_calls([mock.call('', 'foo2', source_collection=sourcemock)])
+        vwdmock.copy.assert_has_calls([mock.call('.', 'foo2', source_collection=sourcemock)])
         vwdmock.copy.assert_has_calls([mock.call('baz/filename', 'filename', source_collection=sourcemock)])
         vwdmock.copy.assert_has_calls([mock.call('subdir', 'subdir', source_collection=sourcemock)])
 
@@ -823,6 +825,9 @@ class TestContainer(unittest.TestCase):
 
 
 class TestWorkflow(unittest.TestCase):
+    def setUp(self):
+        cwltool.process._names = set()
+
     def helper(self, runner, enable_reuse=True):
         document_loader, avsc_names, schema_metadata, metaschema_loader = cwltool.process.get_schema("v1.1")
 
@@ -958,7 +963,7 @@ class TestWorkflow(unittest.TestCase):
             }))
         mockc.open().__enter__().write.assert_has_calls([mock.call(subwf)])
         mockc.open().__enter__().write.assert_has_calls([mock.call(
-bytes(b'''{
+'''{
   "fileblub": {
     "basename": "token.txt",
     "class": "File",
@@ -966,7 +971,7 @@ bytes(b'''{
     "size": 0
   },
   "sleeptime": 5
-}'''))])
+}''')])
 
     # The test passes no builder.resources
     # Hence the default resources will apply: {'cores': 1, 'ram': 1024, 'outdirSize': 1024, 'tmpdirSize': 1024}
@@ -1065,6 +1070,5 @@ bytes(b'''{
 
         api = mock.MagicMock()
         api._rootDesc = copy.deepcopy(get_rootDesc())
-        del api._rootDesc.get('resources')['jobs']['methods']['create']
         runner = arvados_cwl.executor.ArvCwlExecutor(api)
         self.assertEqual(runner.work_api, 'containers')