mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-31 05:13:49 +02:00
Fix tests
This commit is contained in:
parent
46cbcd6132
commit
a6da2406a0
@ -79,6 +79,12 @@ def test_start(loop, vm):
|
|||||||
|
|
||||||
def test_stop(loop, vm):
|
def test_stop(loop, vm):
|
||||||
process = MagicMock()
|
process = MagicMock()
|
||||||
|
|
||||||
|
# Wait process kill success
|
||||||
|
future = asyncio.Future()
|
||||||
|
future.set_result(True)
|
||||||
|
process.wait.return_value = future
|
||||||
|
|
||||||
with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True):
|
with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True):
|
||||||
with asyncio_patch("asyncio.create_subprocess_exec", return_value=process):
|
with asyncio_patch("asyncio.create_subprocess_exec", return_value=process):
|
||||||
nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"})
|
nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"})
|
||||||
@ -92,6 +98,12 @@ def test_stop(loop, vm):
|
|||||||
|
|
||||||
def test_reload(loop, vm):
|
def test_reload(loop, vm):
|
||||||
process = MagicMock()
|
process = MagicMock()
|
||||||
|
|
||||||
|
# Wait process kill success
|
||||||
|
future = asyncio.Future()
|
||||||
|
future.set_result(True)
|
||||||
|
process.wait.return_value = future
|
||||||
|
|
||||||
with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True):
|
with asyncio_patch("gns3server.modules.vpcs.vpcs_vm.VPCSVM._check_requirements", return_value=True):
|
||||||
with asyncio_patch("asyncio.create_subprocess_exec", return_value=process):
|
with asyncio_patch("asyncio.create_subprocess_exec", return_value=process):
|
||||||
nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"})
|
nio = VPCS.instance().create_nio(vm.vpcs_path, {"type": "nio_udp", "lport": 4242, "rport": 4243, "rhost": "127.0.0.1"})
|
||||||
|
@ -27,7 +27,10 @@ from gns3server.version import __version__
|
|||||||
|
|
||||||
def test_locale_check():
|
def test_locale_check():
|
||||||
|
|
||||||
|
try:
|
||||||
locale.setlocale(locale.LC_ALL, ("fr_FR"))
|
locale.setlocale(locale.LC_ALL, ("fr_FR"))
|
||||||
|
except: # Locale is not available on the server
|
||||||
|
return
|
||||||
main.locale_check()
|
main.locale_check()
|
||||||
assert locale.getlocale() == ('fr_FR', 'UTF-8')
|
assert locale.getlocale() == ('fr_FR', 'UTF-8')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user