mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 06:37:17 +00:00
[#149 state:fixed] Fixed crash on result saving.
This commit is contained in:
@@ -137,6 +137,7 @@ class TestCaseDupeGuru:
|
||||
eq_(len(app.results.groups), 0)
|
||||
|
||||
def test_rename_when_nothing_is_selected(self):
|
||||
# Issue #140
|
||||
# It's possible that rename operation has its selected row swept off from under it, thus
|
||||
# making the selected row None. Don't crash when it happens.
|
||||
dgapp = DupeGuru()
|
||||
|
||||
@@ -77,6 +77,18 @@ class TestCaseResultsEmpty:
|
||||
self.results.groups = []
|
||||
assert not self.results.is_modified
|
||||
|
||||
def test_save_to_same_name_as_folder(self, tmpdir):
|
||||
# Issue #149
|
||||
# When saving to a filename that already exists, the file is overwritten. However, when
|
||||
# the name exists but that it's a folder, then there used to be a crash. The proper fix
|
||||
# would have been some kind of feedback to the user, but the work involved for something
|
||||
# that simply never happens (I never received a report of this crash, I experienced it
|
||||
# while fooling around) is too much. Instead, use standard name conflict resolution.
|
||||
folderpath = tmpdir.join('foo')
|
||||
folderpath.mkdir()
|
||||
self.results.save_to_xml(str(folderpath)) # no crash
|
||||
assert tmpdir.join('[000] foo').check()
|
||||
|
||||
|
||||
class TestCaseResultsWithSomeGroups:
|
||||
def setup_method(self, method):
|
||||
|
||||
Reference in New Issue
Block a user