[swarming] add assertion for isolated format

I will rely on this not to mix digest/isolated digest in recipe.

Bug: 1138100
Change-Id: Ia771336d8092100ebb97ac748346bd518d7af297
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/recipes-py/+/2474042
Reviewed-by: Ye Kuang <yekuang@google.com>
Commit-Queue: Ye Kuang <yekuang@google.com>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
diff --git a/README.recipes.md b/README.recipes.md
index 0a69219..1ecd92b 100644
--- a/README.recipes.md
+++ b/README.recipes.md
@@ -3177,7 +3177,7 @@
 
 [DEPS](/recipe_modules/swarming/__init__.py#8): [buildbucket](#recipe_modules-buildbucket), [cas](#recipe_modules-cas), [cipd](#recipe_modules-cipd), [context](#recipe_modules-context), [isolated](#recipe_modules-isolated), [json](#recipe_modules-json), [path](#recipe_modules-path), [properties](#recipe_modules-properties), [raw\_io](#recipe_modules-raw_io), [runtime](#recipe_modules-runtime), [step](#recipe_modules-step)
 
-#### **class [SwarmingApi](/recipe_modules/swarming/api.py#1209)([RecipeApi](/recipe_engine/recipe_api.py#856)):**
+#### **class [SwarmingApi](/recipe_modules/swarming/api.py#1211)([RecipeApi](/recipe_engine/recipe_api.py#856)):**
 
 API for interacting with swarming.
 
@@ -3187,11 +3187,11 @@
 This module will deploy the client to [CACHE]/swarming_client/; users should
 add this path to the named cache for their builder.
 
-&emsp; **@property**<br>&mdash; **def [bot\_id](/recipe_modules/swarming/api.py#1232)(self):**
+&emsp; **@property**<br>&mdash; **def [bot\_id](/recipe_modules/swarming/api.py#1234)(self):**
 
 Swarming bot ID executing this task.
 
-&mdash; **def [collect](/recipe_modules/swarming/api.py#1375)(self, name, tasks, output_dir=None, task_output_stdout='json', timeout=None, eager=False, verbose=False):**
+&mdash; **def [collect](/recipe_modules/swarming/api.py#1377)(self, name, tasks, output_dir=None, task_output_stdout='json', timeout=None, eager=False, verbose=False):**
 
 Waits on a set of Swarming tasks.
 
@@ -3214,11 +3214,11 @@
 Returns:
   A list of TaskResult objects.
 
-&mdash; **def [ensure\_client](/recipe_modules/swarming/api.py#1259)(self):**
+&mdash; **def [ensure\_client](/recipe_modules/swarming/api.py#1261)(self):**
 
-&mdash; **def [initialize](/recipe_modules/swarming/api.py#1242)(self):**
+&mdash; **def [initialize](/recipe_modules/swarming/api.py#1244)(self):**
 
-&emsp; **@contextlib.contextmanager**<br>&mdash; **def [on\_path](/recipe_modules/swarming/api.py#1274)(self):**
+&emsp; **@contextlib.contextmanager**<br>&mdash; **def [on\_path](/recipe_modules/swarming/api.py#1276)(self):**
 
 This context manager ensures the go swarming client is available on
 $PATH.
@@ -3228,11 +3228,11 @@
     with api.swarming.on_path():
       # do your steps which require the swarming binary on path
 
-&emsp; **@property**<br>&mdash; **def [task\_id](/recipe_modules/swarming/api.py#1237)(self):**
+&emsp; **@property**<br>&mdash; **def [task\_id](/recipe_modules/swarming/api.py#1239)(self):**
 
 This task's Swarming ID.
 
-&mdash; **def [task\_request](/recipe_modules/swarming/api.py#1306)(self):**
+&mdash; **def [task\_request](/recipe_modules/swarming/api.py#1308)(self):**
 
 Creates a new TaskRequest object.
 
@@ -3242,14 +3242,14 @@
 Once your TaskRequest is complete, you can pass it to `trigger` in order to
 have it start running on the swarming server.
 
-&mdash; **def [task\_request\_from\_jsonish](/recipe_modules/swarming/api.py#1317)(self, json_d):**
+&mdash; **def [task\_request\_from\_jsonish](/recipe_modules/swarming/api.py#1319)(self, json_d):**
 
 Creates a new TaskRequest object from a JSON-serializable dict.
 
 The input argument should match the schema as the output of
 TaskRequest.to_jsonish().
 
-&mdash; **def [trigger](/recipe_modules/swarming/api.py#1325)(self, step_name, requests, verbose=False):**
+&mdash; **def [trigger](/recipe_modules/swarming/api.py#1327)(self, step_name, requests, verbose=False):**
 
 Triggers a set of Swarming tasks.
 
@@ -3262,7 +3262,7 @@
 Returns:
   A list of TaskRequestMetadata objects.
 
-&emsp; **@contextlib.contextmanager**<br>&mdash; **def [with\_server](/recipe_modules/swarming/api.py#1288)(self, server):**
+&emsp; **@contextlib.contextmanager**<br>&mdash; **def [with\_server](/recipe_modules/swarming/api.py#1290)(self, server):**
 
 This context sets the server for Swarming calls.
 
diff --git a/recipe_modules/swarming/api.py b/recipe_modules/swarming/api.py
index 6ed61de..5fafd6f 100644
--- a/recipe_modules/swarming/api.py
+++ b/recipe_modules/swarming/api.py
@@ -426,6 +426,8 @@
       assert isinstance(isolated, basestring)
       assert not self._cas_input_root, (
           "both cas_input_root and isolated cannot be specified")
+      assert '/' not in isolated, ("isolated should not have '/': %s" %
+                                   isolated)
       ret = self._copy()
       ret._isolated = isolated
       return ret