intial take on ceph-brag-client and tox. Python 2.7 passes

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
This commit is contained in:
Alfredo Deza 2014-05-28 10:55:22 -04:00
parent d4e8119833
commit 59b7113ca3
5 changed files with 86 additions and 0 deletions

28
src/test/python/.gitignore vendored Normal file
View File

@ -0,0 +1,28 @@
*.py[co]
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.idea
.mr.developer.cfg

View File

@ -0,0 +1 @@
ceph_brag.py

View File

@ -0,0 +1,31 @@
import os
from setuptools import setup, find_packages
# link ceph-brag client 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, 'brag/client/ceph-brag')
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_brag.py')
setup(
name='ceph_brag',
version='0.1',
description='',
author='',
author_email='',
install_requires=[
"requests",
],
zip_safe=False,
packages=find_packages(),
#packages=find_packages(exclude=['ez_setup'])
)

View File

@ -0,0 +1,10 @@
import ceph_brag
# This file tests nothing (yet) except for being able to import ceph_brag
# 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 TestCephBrag(object):
def test_basic(self):
assert True

View File

@ -0,0 +1,16 @@
[tox]
envlist = py26, py27, flake8
skipsdist=True
[testenv]
deps=
pytest
commands=
python setup.py develop
py.test -v
[testenv:flake8]
deps=
flake8
commands=flake8 --select=F ceph_brag.py