mirror of
https://github.com/nicolargo/glances.git
synced 2024-09-21 01:28:04 +03:00
Correct unitests
This commit is contained in:
parent
83170d7da5
commit
15173dd431
@ -2,7 +2,7 @@
|
||||
#
|
||||
# This file is part of Glances.
|
||||
#
|
||||
# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com>
|
||||
# Copyright (C) 2021 Nicolargo <nicolas@nicolargo.com>
|
||||
#
|
||||
# Glances is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
# Glances - An eye on your system
|
||||
#
|
||||
# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com>
|
||||
# Copyright (C) 2021 Nicolargo <nicolas@nicolargo.com>
|
||||
#
|
||||
# Glances is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
"""Glances unitary tests suite for the RESTful API."""
|
||||
|
||||
import os
|
||||
import shlex
|
||||
import subprocess
|
||||
import time
|
||||
@ -64,7 +65,11 @@ class TestGlances(unittest.TestCase):
|
||||
global pid
|
||||
|
||||
print('INFO: [TEST_000] Start the Glances Web Server')
|
||||
cmdline = "python -m glances -w -p %s" % SERVER_PORT
|
||||
if os.path.isfile('./venv/bin/python'):
|
||||
cmdline = "./venv/bin/python"
|
||||
else:
|
||||
cmdline = "python"
|
||||
cmdline += " -m glances -w -p %s" % SERVER_PORT
|
||||
print("Run the Glances Web Server on port %s" % SERVER_PORT)
|
||||
args = shlex.split(cmdline)
|
||||
pid = subprocess.Popen(args)
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
"""Glances unitary tests suite for the XML-RPC API."""
|
||||
|
||||
import os
|
||||
import json
|
||||
import shlex
|
||||
import subprocess
|
||||
@ -53,7 +54,11 @@ class TestGlances(unittest.TestCase):
|
||||
global pid
|
||||
|
||||
print('INFO: [TEST_000] Start the Glances Web Server')
|
||||
cmdline = "python -m glances -s -p %s" % SERVER_PORT
|
||||
if os.path.isfile('./venv/bin/python'):
|
||||
cmdline = "./venv/bin/python"
|
||||
else:
|
||||
cmdline = "python"
|
||||
cmdline += " -m glances -s -p %s" % SERVER_PORT
|
||||
print("Run the Glances Server on port %s" % SERVER_PORT)
|
||||
args = shlex.split(cmdline)
|
||||
pid = subprocess.Popen(args)
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
# Glances - An eye on your system
|
||||
#
|
||||
# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com>
|
||||
# Copyright (C) 2021 Nicolargo <nicolas@nicolargo.com>
|
||||
#
|
||||
# Glances is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
|
Loading…
Reference in New Issue
Block a user