From 3dcd8c2bc05d49473d991b71109087cc80a021a7 Mon Sep 17 00:00:00 2001
From: John Chilton <jmchilton@gmail.com>
Date: Sun, 8 Sep 2013 18:42:18 -0500
Subject: [PATCH] Test for default_action_type="copy" and corresponding bug
 fixes.

---
 lwr/lwr_client/client.py | 10 +++++-----
 test/check.py            |  4 +++-
 test/integration_test.py |  3 +++
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/lwr/lwr_client/client.py b/lwr/lwr_client/client.py
index 16c5b98f..7a2daa28 100644
--- a/lwr/lwr_client/client.py
+++ b/lwr/lwr_client/client.py
@@ -125,7 +125,7 @@ class Client(object):
     @parseJson()
     def _get_output_type(self, name):
         return self._raw_execute("get_output_type", {"name": name,
-                                                      "job_id": self.job_id})
+                                                     "job_id": self.job_id})
 
     def fetch_output(self, path, working_directory, action='transfer'):
         """
@@ -183,10 +183,10 @@ class Client(object):
 
     @parseJson()
     def _output_path(self, name, job_id, output_type):
-        self._raw_execute("output_path",
-                           {"name": name,
-                            "job_id": self.job_id,
-                            "output_type": output_type})
+        return self._raw_execute("output_path",
+                                 {"name": name,
+                                  "job_id": self.job_id,
+                                  "output_type": output_type})
 
     @retry()
     def __raw_download_output(self, name, job_id, output_type, output_path):
diff --git a/test/check.py b/test/check.py
index c1f1acbf..c926d1cb 100644
--- a/test/check.py
+++ b/test/check.py
@@ -78,7 +78,9 @@ finally:
                            cleanup_job='never',
                            work_dir_outputs=[],
                            output_files=[temp_output_path])
-        finish_job(**finish_args)
+        failed = finish_job(**finish_args)
+        if failed:
+            raise Exception("Failed to finish job correctly")
         #client.download_output(temp_output_path, temp_directory)
         output_file = open(temp_output_path, 'r')
         try:
diff --git a/test/integration_test.py b/test/integration_test.py
index 0d677b56..7f2fb37a 100644
--- a/test/integration_test.py
+++ b/test/integration_test.py
@@ -11,6 +11,9 @@ except ImportError:
 
 class IntegrationTest(TempDirectoryTestCase):
 
+    def test_integration_copy(self):
+        self.__run(private_token=None, transport=None, cache=False, test_errors=False, default_file_action="copy")
+
     def test_integration_no_transfer(self):
         self.__run(private_token=None, transport=None, cache=False, test_errors=False, default_file_action="none")
 
-- 
GitLab