Seeing if indenting more fixes

This commit is contained in:
Jason Rosenzweig 2021-07-20 00:51:28 +08:00
parent 2219b0f0ac
commit ce2c48b972
No known key found for this signature in database
GPG Key ID: 666E4F1B0D61087C
1 changed files with 13 additions and 13 deletions

View File

@ -150,12 +150,12 @@ class TestFileCompletion:
# _set_fileview_root isn't run unless there is an actual keypress
qtbot.keyPress(prompt._lineedit, Qt.Key_AsciiTilde)
assert (pathlib.Path(prompt._file_model.rootPath()) /
prompt._to_complete) == pathlib.Path.home()
# The first character on the lineedit should remain ~
prompt.item_focus('next')
prompt.item_focus('next')
assert prompt._lineedit.text()[0] == '~'
assert (pathlib.Path(prompt._file_model.rootPath()) /
prompt._to_complete) == pathlib.Path.home()
# The first character on the lineedit should remain ~
prompt.item_focus('next')
prompt.item_focus('next')
assert prompt._lineedit.text()[0] == '~'
def test_expand_once(self, qtbot, get_prompt, home_path):
home_path.joinpath(*home_path.parts[1:]).mkdir(parents=True)
@ -166,8 +166,8 @@ class TestFileCompletion:
# _set_fileview_root isn't run unless there is an actual keypress
qtbot.keyPress(prompt._lineedit, Qt.Key_Slash)
# The second instance of home_path shouldn't be replaced with ~
assert prompt._lineedit.text()[:-1] == '~' + str(home_path)
# The second instance of home_path shouldn't be replaced with ~
assert prompt._lineedit.text()[:-1] == '~' + str(home_path)
def test_dont_contract(self, qtbot, get_prompt, home_path):
for directory in ['bar', 'bat', 'foo']:
@ -179,8 +179,8 @@ class TestFileCompletion:
# _set_fileview_root isn't run unless there is an actual keypress
qtbot.keyPress(prompt._lineedit, Qt.Key_Slash)
prompt.item_focus('next')
prompt.item_focus('next')
# If $HOME is contracted to `~` this test will fail as that is unexpected
assert (prompt._lineedit.text() !=
prompt._lineedit.text().replace(os.path.expanduser('~'), '~', 1))
prompt.item_focus('next')
prompt.item_focus('next')
# If $HOME is contracted to `~` this test will fail as that is unexpected
assert (prompt._lineedit.text() !=
prompt._lineedit.text().replace(os.path.expanduser('~'), '~', 1))