Add unittests dir 33/23233/13
authorMorgan Richomme <morgan.richomme@orange.com>
Mon, 17 Oct 2016 14:14:50 +0000 (16:14 +0200)
committerMorgan Richomme <morgan.richomme@orange.com>
Wed, 19 Oct 2016 13:20:51 +0000 (15:20 +0200)
JIRA: FUNCTEST-336

Change-Id: Icd958552fafb4e8dc58f9008586bcaf33862ccd4
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
run_unit_tests.sh [new file with mode: 0755]
setup.py [new file with mode: 0644]
unit_tests/__init__.py [new file with mode: 0644]

diff --git a/run_unit_tests.sh b/run_unit_tests.sh
new file mode 100755 (executable)
index 0000000..a37cd3d
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -o errexit
+set -o pipefail
+
+echo "Running unit tests..."
+cd .
+
+# start vitual env
+virtualenv ./functest_venv
+source ./functest_venv/bin/activate
+
+# install python packages
+easy_install -U setuptools
+easy_install -U pip
+pip install -r docker/requirements.pip
+pip install -e .
+
+# unit tests
+nosetests --with-xunit \
+         --with-coverage \
+         --cover-package=functest\
+         --cover-xml \
+         unit_tests
+
+deactivate
diff --git a/setup.py b/setup.py
new file mode 100644 (file)
index 0000000..58740f4
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,24 @@
+##############################################################################
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+from setuptools import setup, find_packages
+
+
+setup(
+    name="functest",
+    version="master",
+    packages=find_packages(),
+    include_package_data=True,
+    package_data={
+    },
+    url="https://www.opnfv.org",
+    install_requires=["coverage==4.1",
+                      "mock==1.3.0",
+                      "nose==1.3.7"],
+    entry_points={
+    }
+)
diff --git a/unit_tests/__init__.py b/unit_tests/__init__.py
new file mode 100644 (file)
index 0000000..e69de29