From: Alfredo Deza Date: Wed, 1 Jul 2015 12:14:38 +0000 (-0400) Subject: test: create python test files for ceph cli X-Git-Tag: v9.0.3~88^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e296793eead7369cfbe0e9f3626b67233ac2a747;p=ceph.git test: create python test files for ceph cli Signed-off-by: Alfredo Deza --- diff --git a/src/test/python/ceph/setup.py b/src/test/python/ceph/setup.py new file mode 100644 index 0000000000000..e538ed69864d1 --- /dev/null +++ b/src/test/python/ceph/setup.py @@ -0,0 +1,27 @@ +import os +from setuptools import setup, find_packages + +# link ceph script here so we can "install" it +current_dir = os.path.abspath(os.path.dirname(__file__)) +src_dir = os.path.dirname(os.path.dirname(os.path.dirname(current_dir))) +script_path = os.path.join(src_dir, 'ceph.in') + + +def link_target(source, destination): + if not os.path.exists(destination): + try: + os.symlink(source, destination) + except (IOError, OSError) as error: + print 'Ignoring linking of target: %s' % str(error) + +link_target(script_path, 'ceph.py') + +setup( + name='ceph', + version='0.1', + description='', + author='', + author_email='', + zip_safe=False, + packages=find_packages(), +) diff --git a/src/test/python/ceph/tests/test_ceph.py b/src/test/python/ceph/tests/test_ceph.py new file mode 100644 index 0000000000000..d26493ea11f97 --- /dev/null +++ b/src/test/python/ceph/tests/test_ceph.py @@ -0,0 +1,10 @@ +import ceph + +# This file tests nothing (yet) except for being able to import ceph +# correctly and thus ensuring somewhat that it will work under different Python +# versions. You must write unittests here so that code has adequate coverage. + +class TestCeph(object): + + def test_basic(self): + assert True diff --git a/src/test/python/ceph/tox.ini b/src/test/python/ceph/tox.ini new file mode 100644 index 0000000000000..6f28f577e9d8f --- /dev/null +++ b/src/test/python/ceph/tox.ini @@ -0,0 +1,18 @@ +[tox] +envlist = py26, py27, flake8 +skipsdist=True + +[testenv] +deps= + pytest +setenv = + PYTHONPATH = {toxinidir}/../../../pybind + +commands= + python setup.py develop + py.test -v + +[testenv:flake8] +deps= + flake8 +commands=flake8 --select=F ceph.py