mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
3 files changed
+11
-4
No files matched your search
@@ -17,7 +17,7 @@
|
||||
|
||||
import os
|
||||
import pytest
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
from gns3server.controller.project import Project
|
||||
from gns3server.controller.snapshot import Snapshot
|
||||
@@ -90,9 +90,14 @@ def test_restore(project, controller, async_run):
|
||||
assert os.path.exists(test_file)
|
||||
assert len(project.nodes) == 2
|
||||
|
||||
controller._notification = MagicMock()
|
||||
with patch("gns3server.config.Config.get_section_config", return_value={"local": True}):
|
||||
async_run(snapshot.restore())
|
||||
|
||||
# project.closed notification should not be send when restoring snapshots
|
||||
assert "project.closed" not in [c[0][0] for c in controller.notification.emit.call_args_list]
|
||||
|
||||
|
||||
project = controller.get_project(project.id)
|
||||
assert not os.path.exists(test_file)
|
||||
assert len(project.nodes) == 1
|
||||
Reference in new issue
Block a user