Skip to content

Commit dab5922

Browse files
committed
Fixes test cases loading against UnitTesting v1.8.4+
> see SublimeText/UnitTesting#277
1 parent b304d08 commit dab5922

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

__init__.py

Whitespace-only changes.

tests/test_ssh_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from pathlib import Path
88
from unittest.mock import patch
99

10-
from sshubl.ssh_utils import ssh_forward
10+
from ..sshubl.ssh_utils import ssh_forward
1111

1212

1313
class TestSshUtils(unittest.TestCase):
@@ -19,7 +19,7 @@ def test_ssh_forward(self) -> None:
1919
identifier = uuid.uuid4()
2020

2121
# below forwarding request/cancellation will succeed
22-
with patch("sshubl.ssh_utils.subprocess.check_output") as check_output_mock:
22+
with patch("SSHubl.sshubl.ssh_utils.subprocess.check_output") as check_output_mock:
2323
check_output_mock.return_value = ""
2424

2525
# "-O forward -L 127.0.0.1:8888:127.0.0.1:22"
@@ -65,7 +65,7 @@ def test_ssh_forward(self) -> None:
6565
self.assertFalse(local_unix_socket.exists())
6666

6767
# below forwarding request causes 4242 port to be allocated by remote (printed to stdout)
68-
with patch("sshubl.ssh_utils.subprocess.check_output") as check_output_mock:
68+
with patch("SSHubl.sshubl.ssh_utils.subprocess.check_output") as check_output_mock:
6969
check_output_mock.return_value = "4242\n"
7070

7171
# "-O forward -R 127.0.0.1:0:[::1]:8888"
@@ -87,7 +87,7 @@ def test_ssh_forward(self) -> None:
8787
)
8888

8989
# below forwarding request fails
90-
with patch("sshubl.ssh_utils.subprocess.check_output") as check_output_mock:
90+
with patch("SSHubl.sshubl.ssh_utils.subprocess.check_output") as check_output_mock:
9191
check_output_mock.side_effect = subprocess.CalledProcessError(
9292
1,
9393
"",

tests/test_st_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
import sublime_plugin
88

9-
from sshubl.commands import SshTerminalCommand
10-
from sshubl.st_utils import (
9+
from ..sshubl.commands import SshTerminalCommand
10+
from ..sshubl.st_utils import (
1111
format_ip_addr,
1212
get_absolute_purepath_flavour,
1313
get_command_class,
@@ -33,7 +33,8 @@ class TestFakeCommand(sublime_plugin.WindowCommand):
3333
]
3434

3535
with patch(
36-
"sshubl.st_utils.sublime_plugin.window_command_classes", window_command_classes_mock
36+
"SSHubl.sshubl.st_utils.sublime_plugin.window_command_classes",
37+
window_command_classes_mock,
3738
):
3839
# unknown command, looked up twice
3940
self.assertIsNone(get_command_class("_UnknownCommand"))
@@ -67,7 +68,7 @@ def test_get_absolute_purepath_flavour(self) -> None:
6768
self.assertIsNone(get_absolute_purepath_flavour(""))
6869
self.assertIsNone(get_absolute_purepath_flavour("./rel/path"))
6970

70-
@patch("sshubl.st_utils.getpass.getuser", return_value="login")
71+
@patch("SSHubl.sshubl.st_utils.getpass.getuser", return_value="login")
7172
def test_parse_ssh_connection(self, _) -> None:
7273
"""parse_ssh_connection test cases"""
7374
self.assertTupleEqual(

0 commit comments

Comments
 (0)