mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix some bugs on windows
This commit is contained in:
5 files changed
+14
-8
No files matched your search
@@ -136,7 +136,7 @@ def test_get_abs_image_additional_image_paths(qemu, tmpdir):
|
||||
|
||||
with patch("gns3server.config.Config.get_section_config", return_value={
|
||||
"images_path": str(tmpdir / "images1"),
|
||||
"additional_images_path": "/tmp/null24564:{}".format(tmpdir / "images2"),
|
||||
"additional_images_path": "/tmp/null24564:{}".format(str(tmpdir / "images2")),
|
||||
"local": False}):
|
||||
assert qemu.get_abs_image_path("test1.bin") == path1
|
||||
assert qemu.get_abs_image_path("test2.bin") == path2
|
||||
|
||||
@@ -77,8 +77,13 @@ def test_convert(directory, tmpdir):
|
||||
file_path = os.path.join(work_directory, directory, file)
|
||||
assert os.path.exists(file_path), "{} is missing".format(os.path.join(directory, file))
|
||||
|
||||
# For gns3project we check if size are not too much differents
|
||||
if file_path.endswith(".gns3project"):
|
||||
size = os.stat(file_path).st_size
|
||||
other_size = os.stat(os.path.join(os.path.join(root, file))).st_size
|
||||
assert size in range(other_size - 100, other_size + 100), "File {} is different".format(os.path.join(directory, file))
|
||||
# For non .gns3 file we check if the file are the same
|
||||
if not file_path.endswith(".gns3"):
|
||||
elif not file_path.endswith(".gns3"):
|
||||
assert os.stat(file_path).st_size == os.stat(os.path.join(os.path.join(root, file))).st_size, "File {} is different".format(os.path.join(directory, file))
|
||||
|
||||
# Check if we don't have unexpected file in work directory
|
||||
|
||||
+3
-1
@@ -15,7 +15,7 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
import sys
|
||||
from gns3server.utils import *
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ def test_force_unix_path():
|
||||
assert force_unix_path("a/b") == "a/b"
|
||||
assert force_unix_path("a\\b") == "a/b"
|
||||
assert force_unix_path("a\\b\\..\\c") == "a/c"
|
||||
if sys.platform.startswith("win"):
|
||||
assert force_unix_path("C:\Temp") == "C:/Temp"
|
||||
|
||||
|
||||
def test_macaddress_to_int():
|
||||
|
||||
Reference in new issue
Block a user