mirror of https://github.com/nicolargo/glances
Add Tox file for testing
parent
6915cf887d
commit
736c8ec7ae
|
@ -40,3 +40,6 @@ local.properties
|
|||
|
||||
# Sphinx
|
||||
_build
|
||||
|
||||
# Tox
|
||||
.tox/
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# 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
|
||||
# ==============
|
||||
|
|
Loading…
Reference in New Issue