Index: recipes/engine_tests/missing_start_dir.py |
diff --git a/recipes/engine_tests/missing_start_dir.py b/recipes/engine_tests/missing_start_dir.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bb28f0fd3f119ef492fdf04cf99b37e999b907cd |
--- /dev/null |
+++ b/recipes/engine_tests/missing_start_dir.py |
@@ -0,0 +1,27 @@ |
+# Copyright 2017 The LUCI Authors. All rights reserved. |
+# Use of this source code is governed under the Apache License, Version 2.0 |
+# that can be found in the LICENSE file. |
+ |
+"""Tests that deleting the current working directory doesn't immediately fail.""" |
+ |
+DEPS = [ |
+ 'step', |
+ 'path', |
+] |
+ |
+ |
+def RunSteps(api): |
+ api.step('innocent step', ['bash', '-c', "echo some step"]) |
+ api.step('nuke it', ['rm', '-rf', api.path['start_dir']]) |
+ |
+ try: |
+ api.step('bash needs cwd', ['bash', '-c', "echo fail"]) |
+ assert True |
+ except api.step.StepFailure: # pragma: no cover |
+ assert False |
+ |
+ api.step('python does not', ['python', '-c', 'print "hi"']) |
+ |
+ |
+def GenTests(api): |
+ yield api.test('basic') |