mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 02:31:45 +02:00
Make path comparison more robust
This commit is contained in:
@@ -35,6 +35,11 @@ class TestFileTransmission(BaseTest):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
shutil.rmtree(self.tdir)
|
shutil.rmtree(self.tdir)
|
||||||
|
|
||||||
|
def assertPathEqual(self, a, b):
|
||||||
|
a = os.path.abspath(os.path.realpath(a))
|
||||||
|
b = os.path.abspath(os.path.realpath(b))
|
||||||
|
self.ae(a, b)
|
||||||
|
|
||||||
def test_file_put(self):
|
def test_file_put(self):
|
||||||
# send refusal
|
# send refusal
|
||||||
for quiet in (0, 1, 2):
|
for quiet in (0, 1, 2):
|
||||||
@@ -52,7 +57,7 @@ class TestFileTransmission(BaseTest):
|
|||||||
self.assertIsNone(ft.active_cmds[''].file)
|
self.assertIsNone(ft.active_cmds[''].file)
|
||||||
self.ae(ft.test_responses, [] if quiet else [{'status': 'OK'}])
|
self.ae(ft.test_responses, [] if quiet else [{'status': 'OK'}])
|
||||||
ft.handle_serialized_command(serialized_cmd(action='data', data='abcd'))
|
ft.handle_serialized_command(serialized_cmd(action='data', data='abcd'))
|
||||||
self.ae(ft.active_cmds[''].file.name, dest)
|
self.assertPathEqual(ft.active_cmds[''].file.name, dest)
|
||||||
ft.handle_serialized_command(serialized_cmd(action='end_data', data='123'))
|
ft.handle_serialized_command(serialized_cmd(action='end_data', data='123'))
|
||||||
self.assertFalse(ft.active_cmds)
|
self.assertFalse(ft.active_cmds)
|
||||||
self.ae(ft.test_responses, [] if quiet else [{'status': 'OK'}, {'status': 'COMPLETED'}])
|
self.ae(ft.test_responses, [] if quiet else [{'status': 'OK'}, {'status': 'COMPLETED'}])
|
||||||
|
|||||||
Reference in New Issue
Block a user