提交 736c8ec7 编写于 作者: N Nicolargo

Add Tox file for testing

上级 6915cf88
......@@ -40,3 +40,6 @@ local.properties
# Sphinx
_build
# Tox
.tox/
# Tox (http://tox.testrun.org/) is a tool for running tests
# Install:
# pip install tox
# Run:
# tox
[tox]
envlist = py27, py34
[testenv]
deps =
flake8
requests
psutil
bottle
batinfo
https://bitbucket.org/gleb_zhulik/py3sensors/get/tip.tar.gz
commands =
python unitest.py
python unitest-restful.py
python unitest-xmlrpc.py
#flake8 --exclude=build,.tox,.git
......@@ -123,7 +123,7 @@ class TestGlances(unittest.TestCase):
plist = requests.get("%s/%s" % (URL, method))
print plist.json()
print(plist.json())
for p in plist.json():
print("HTTP RESTFul request: %s/%s" % (URL, p))
......
......@@ -27,9 +27,13 @@ import time
import unittest
import shlex
import subprocess
import xmlrpclib
import json
import types
try:
from xmlrpc.client import ServerProxy
except ImportError:
# Python 2
from xmlrpclib import ServerProxy
from glances.core.glances_globals import (
appname,
......@@ -68,7 +72,7 @@ from glances.core.glances_stats import GlancesStats
stats = GlancesStats()
# Init the XML/RCP client
client = xmlrpclib.ServerProxy(URL)
client = ServerProxy(URL)
# Unitest class
# ==============
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册