Files
picard/test/picardtestcase.py
Wieland Hoffmann e624aa121c Make PicardTestCase the parent class of all tests
This brings the faketagger and, more importantly, settings reset to all of them.
2018-10-23 17:32:50 +02:00

39 lines
774 B
Python

# -*- coding: utf-8 -*-
import unittest
from PyQt5 import QtCore
from picard import (
config,
log,
)
class FakeTagger(QtCore.QObject):
tagger_stats_changed = QtCore.pyqtSignal()
def __init__(self):
QtCore.QObject.__init__(self)
QtCore.QObject.config = config
QtCore.QObject.log = log
self.tagger_stats_changed.connect(self.emit)
self.exit_cleanup = []
self.files = {}
def register_cleanup(self, func):
self.exit_cleanup.append(func)
def run_cleanup(self):
for f in self.exit_cleanup:
f()
def emit(self, *args):
pass
class PicardTestCase(unittest.TestCase):
def setUp(self):
QtCore.QObject.tagger = FakeTagger()
config.setting = {}