1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 06:37:17 +00:00

Fail with excplicit message when unable to load results file

Previously, we would simply show an empty results window. Not very
helpful.
This commit is contained in:
Virgil Dupras
2016-06-07 21:34:04 -04:00
parent ef8f8f0e44
commit 80f659858c
4 changed files with 15 additions and 10 deletions

View File

@@ -9,6 +9,7 @@ import os.path as op
from xml.etree import ElementTree as ET
from pytest import raises
from hscommon.testutil import eq_
from hscommon.util import first
@@ -614,16 +615,15 @@ class TestCaseResultsXML:
f.seek(0)
app = DupeGuru()
r = Results(app)
r.load_from_xml(f, None)
with raises(ET.ParseError):
r.load_from_xml(f, None)
eq_(0, len(r.groups))
def test_load_non_existant_xml(self):
app = DupeGuru()
r = Results(app)
try:
with raises(IOError):
r.load_from_xml('does_not_exist.xml', None)
except IOError:
self.fail()
eq_(0, len(r.groups))
def test_remember_match_percentage(self):