mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-25 06:33:09 +00:00
Tests for normal mode home dir expansion
This commit is contained in:
parent
995c447435
commit
47913a7c1f
2 changed files with 11 additions and 3 deletions
|
|
@ -721,7 +721,7 @@ func files_for_receive(opts *Options, dest string, files []*remote_file, remote_
|
|||
})
|
||||
} else {
|
||||
f := files_for_spec[0]
|
||||
f.expanded_local_path = dest
|
||||
f.expanded_local_path = expand_home(dest)
|
||||
ans = append(ans, f)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -451,6 +451,13 @@ class TestFileTransmission(BaseTest):
|
|||
src = os.path.join(self.tdir, 'src')
|
||||
with open(src, 'wb') as s:
|
||||
s.write(self.src_data)
|
||||
# home dir expansion
|
||||
fname = 'tstest-file'
|
||||
home = os.path.dirname(src)
|
||||
with set_paths(home=home), self.run_kitten(['~/'+os.path.basename(src), f'~/{fname}'], home_dir=home) as pty:
|
||||
pty.wait_till_child_exits(require_exit_code=0)
|
||||
os.remove(os.path.join(home, fname))
|
||||
|
||||
|
||||
def test_transfer_send(self):
|
||||
self.basic_transfer_tests()
|
||||
|
|
@ -458,9 +465,10 @@ class TestFileTransmission(BaseTest):
|
|||
with open(src, 'wb') as s:
|
||||
s.write(self.src_data)
|
||||
|
||||
# remote home
|
||||
# home dir expansion
|
||||
fname = 'tstest-file'
|
||||
with set_paths(home=self.tdir), self.run_kitten([src, '~/'+fname]) as pty:
|
||||
home = os.path.dirname(src)
|
||||
with set_paths(home=home), self.run_kitten(['~/'+os.path.basename(src), '~/'+fname], home_dir=home) as pty:
|
||||
pty.wait_till_child_exits(require_exit_code=0)
|
||||
os.remove(os.path.expanduser('~/'+fname))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue