mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-15 12:59:06 +00: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):
|
||||
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("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"})
|
||||
@ -92,6 +98,12 @@ def test_stop(loop, vm):
|
||||
|
||||
def test_reload(loop, vm):
|
||||
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("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"})
|
||||
|
@ -27,7 +27,10 @@ from gns3server.version import __version__
|
||||
|
||||
def test_locale_check():
|
||||
|
||||
locale.setlocale(locale.LC_ALL, ("fr_FR"))
|
||||
try:
|
||||
locale.setlocale(locale.LC_ALL, ("fr_FR"))
|
||||
except: # Locale is not available on the server
|
||||
return
|
||||
main.locale_check()
|
||||
assert locale.getlocale() == ('fr_FR', 'UTF-8')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user