From 126b2c543617866e9e1ea45ef9c5770ce5f5dda9 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Wed, 12 Nov 2014 16:11:37 -0500 Subject: Add an API example base and functional test base Add examples/common.py, which is a basic common setup that mimics OSC's configuration options and logging without the rest of the CLI. Also add the functional test tooling for examples to prevent bit rot. Co-Authored-By: Dean Troyer Change-Id: Ie92b675eafd93482ddc9a8ce0b0588e23ed50c35 --- functional/common/test.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'functional/common/test.py') diff --git a/functional/common/test.py b/functional/common/test.py index c1bb0b10..464844fa 100644 --- a/functional/common/test.py +++ b/functional/common/test.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +import os import re import shlex import subprocess @@ -19,6 +20,11 @@ import six from functional.common import exceptions +COMMON_DIR = os.path.dirname(os.path.abspath(__file__)) +FUNCTIONAL_DIR = os.path.normpath(os.path.join(COMMON_DIR, '..')) +ROOT_DIR = os.path.normpath(os.path.join(FUNCTIONAL_DIR, '..')) +EXAMPLE_DIR = os.path.join(ROOT_DIR, 'examples') + def execute(cmd, action, flags='', params='', fail_ok=False, merge_stderr=False): -- cgit v1.2.1