Fixed unit test in logbook.py.

pull/54/head
Christian T. Jacobs 2017-03-02 09:56:45 +00:00
rodzic 09a2d3e78b
commit 296997ec4e
3 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with PyQSO. If not, see <http://www.gnu.org/licenses/>.
from gi import require_version
require_version('Gtk', '3.0')
require_version('PangoCairo', '1.0')
from gi.repository import Gtk, GdkPixbuf
import argparse
try:

Wyświetl plik

@ -50,6 +50,7 @@ from pyqso.auxiliary_dialogs import *
from pyqso.log_name_dialog import LogNameDialog
from pyqso.record_dialog import RecordDialog
class Logbook:
""" A Logbook object can store multiple Log objects. """
@ -1275,8 +1276,7 @@ class TestLogbook(unittest.TestCase):
def setUp(self):
""" Set up the Logbook object and connection to the test database needed for the unit tests. """
Gtk.Builder = mock.MagicMock(spec=Gtk.Builder)
self.logbook = Logbook(parent=None, builder=Gtk.Builder)
self.logbook = Logbook(parent=mock.MagicMock())
success = self.logbook.db_connect(os.path.dirname(os.path.realpath(__file__))+"/unittest_resources/test.db")
assert success

Wyświetl plik

@ -64,7 +64,7 @@ class RecordDialog:
if(index is not None):
self.dialog.set_title("Edit Record %d" % index)
else:
self.dialog.set_title("Add Record")
self.dialog.set_title("Add Record")
# Check if a configuration file is present, since we might need it to set up the rest of the dialog.
config = configparser.ConfigParser()