kopia lustrzana https://github.com/ctjacobs/pyqso
Fixed unit test in logbook.py.
rodzic
09a2d3e78b
commit
296997ec4e
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Ładowanie…
Reference in New Issue