From 1212af9a64cdf6533fa9104a17bf449d9a99cf8a Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Sat, 26 Jan 2019 11:45:30 +0100 Subject: [PATCH] fix a unittest --- tests/test_config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index 773c20f..30b75f6 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -4,6 +4,8 @@ import configparser import unittest from unittest.mock import MagicMock, patch import warnings +from shutil import copyfile + from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QApplication @@ -76,8 +78,9 @@ class TestWriteConfiguration(BorgQtTestCase): class TestGuiConfiguration(BorgQtTestCase): def setUp(self): super().setUp() + copyfile(self.config_path, '/tmp/test.conf') + self.form.config._get_path = MagicMock(return_value='/tmp/test.conf') self.form.config.read() - self.form.config.path = '/tmp/test.conf' def tearDown(self): if os.path.exists(self.form.config.path):