Index: recipe_modules/python/example.resources/test.py |
diff --git a/recipe_modules/python/example.resources/test.py b/recipe_modules/python/example.resources/test.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1c678a8ca954a59b8c3112f9234421ad5bbdf797 |
--- /dev/null |
+++ b/recipe_modules/python/example.resources/test.py |
@@ -0,0 +1,45 @@ |
+# 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. |
+ |
+import argparse |
+import os |
+import sys |
+ |
+ |
+def main(): |
+ parser = argparse.ArgumentParser() |
+ parser.add_argument('--verify-enum34', action='store_true') |
+ parser.add_argument('--verify-six', action='store_true') |
+ opts = parser.parse_args() |
+ |
+ if opts.verify_enum34: |
+ import enum |
+ assert enum.version == (1, 1, 6) |
+ if opts.verify_six: |
+ import six |
+ assert six.__version__ == '1.10.0' |
+ return 0 |
+ |
+ |
+if __name__ == '__main__': |
+ sys.exit(main()) |
+ |
+ |
+## |
+# Inline VirtualEnv "vpython" spec. |
+# |
+# Pick a test package with no dependencies from "/bootstrap/venv.cfg" that |
+# differs from the package in "test.vpython" file. |
+# |
+# This is used in "example.py" along with the "--verify-enum34" flag. |
+## |
+# [VPYTHON:BEGIN] |
+# |
+# wheel: < |
+# name: "infra/python/wheels/enum34-py2" |
+# version: "version:1.1.6" |
+# > |
+# |
+# [VPYTHON:END] |
+## |