From 23f7c4dd6ed49336d96c47e489ae1c8e83886c88 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Wed, 26 Jan 2022 00:03:12 -0500 Subject: [PATCH] [Tests] Change example files in files tab test to sort the same on linux/windows --- deluge/tests/test_files_tab.py | 39 ++++++++++++++-------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/deluge/tests/test_files_tab.py b/deluge/tests/test_files_tab.py index 54664e093..416c7bc0b 100644 --- a/deluge/tests/test_files_tab.py +++ b/deluge/tests/test_files_tab.py @@ -8,7 +8,6 @@ import pytest from twisted.trial import unittest import deluge.component as component -from deluge.common import windows_check from deluge.configmanager import ConfigManager from deluge.i18n import setup_translation @@ -98,39 +97,35 @@ class FilesTabTestCase(BaseTestCase): self.assertTrue(ret) def test_files_tab2(self): - if windows_check(): - raise unittest.SkipTest('on windows \\ != / for path names') self.filestab.files_list[self.t_id] = ( - {'index': 0, 'path': '1/1/test_10.txt', 'offset': 0, 'size': 13}, - {'index': 1, 'path': 'test_100.txt', 'offset': 13, 'size': 14}, + {'index': 0, 'path': '1/1/test_100.txt', 'offset': 0, 'size': 13}, + {'index': 1, 'path': 'test_101.txt', 'offset': 13, 'size': 14}, ) self.filestab.update_files() self.filestab._on_torrentfilerenamed_event( - self.t_id, self.index, '1/1/test_100.txt' + self.t_id, self.index, '1/1/test_101.txt' ) ret = self.verify_treestore( self.filestab.treestore, - [['1/', [['1/', [['test_100.txt'], ['test_10.txt']]]]]], + [['1/', [['1/', [['test_100.txt'], ['test_101.txt']]]]]], ) if not ret: self.print_treestore('Treestore not expected:', self.filestab.treestore) self.assertTrue(ret) def test_files_tab3(self): - if windows_check(): - raise unittest.SkipTest('on windows \\ != / for path names') self.filestab.files_list[self.t_id] = ( - {'index': 0, 'path': '1/test_10.txt', 'offset': 0, 'size': 13}, - {'index': 1, 'path': 'test_100.txt', 'offset': 13, 'size': 14}, + {'index': 0, 'path': '1/test_100.txt', 'offset': 0, 'size': 13}, + {'index': 1, 'path': 'test_101.txt', 'offset': 13, 'size': 14}, ) self.filestab.update_files() self.filestab._on_torrentfilerenamed_event( - self.t_id, self.index, '1/test_100.txt' + self.t_id, self.index, '1/test_101.txt' ) ret = self.verify_treestore( - self.filestab.treestore, [['1/', [['test_100.txt'], ['test_10.txt']]]] + self.filestab.treestore, [['1/', [['test_100.txt'], ['test_101.txt']]]] ) if not ret: self.print_treestore('Treestore not expected:', self.filestab.treestore) @@ -138,36 +133,34 @@ class FilesTabTestCase(BaseTestCase): def test_files_tab4(self): self.filestab.files_list[self.t_id] = ( - {'index': 0, 'path': '1/test_10.txt', 'offset': 0, 'size': 13}, - {'index': 1, 'path': '1/test_100.txt', 'offset': 13, 'size': 14}, + {'index': 0, 'path': '1/test_100.txt', 'offset': 0, 'size': 13}, + {'index': 1, 'path': '1/test_101.txt', 'offset': 13, 'size': 14}, ) self.filestab.update_files() self.filestab._on_torrentfilerenamed_event( - self.t_id, self.index, '1/2/test_100.txt' + self.t_id, self.index, '1/2/test_101.txt' ) ret = self.verify_treestore( self.filestab.treestore, - [['1/', [['2/', [['test_100.txt']]], ['test_10.txt']]]], + [['1/', [['2/', [['test_101.txt']]], ['test_100.txt']]]], ) if not ret: self.print_treestore('Treestore not expected:', self.filestab.treestore) self.assertTrue(ret) def test_files_tab5(self): - if windows_check(): - raise unittest.SkipTest('on windows \\ != / for path names') self.filestab.files_list[self.t_id] = ( - {'index': 0, 'path': '1/test_10.txt', 'offset': 0, 'size': 13}, - {'index': 1, 'path': '2/test_100.txt', 'offset': 13, 'size': 14}, + {'index': 0, 'path': '1/test_100.txt', 'offset': 0, 'size': 13}, + {'index': 1, 'path': '2/test_101.txt', 'offset': 13, 'size': 14}, ) self.filestab.update_files() self.filestab._on_torrentfilerenamed_event( - self.t_id, self.index, '1/test_100.txt' + self.t_id, self.index, '1/test_101.txt' ) ret = self.verify_treestore( - self.filestab.treestore, [['1/', [['test_100.txt'], ['test_10.txt']]]] + self.filestab.treestore, [['1/', [['test_100.txt'], ['test_101.txt']]]] ) if not ret: self.print_treestore('Treestore not expected:', self.filestab.treestore)