forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_shell_integration.py
More file actions
48 lines (31 loc) · 1.21 KB
/
test_shell_integration.py
File metadata and controls
48 lines (31 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# import importlib
# from unittest.mock import Mock
# import pythonrc
# def test_decoration_success():
# importlib.reload(pythonrc)
# ps1 = pythonrc.ps1()
# ps1.hooks.failure_flag = False
# result = str(ps1)
# assert result == "\x1b]633;D;0\x07\x1b]633;A\x07>>> \x1b]633;B\x07\x1b]633;C\x07"
# def test_decoration_failure():
# importlib.reload(pythonrc)
# ps1 = pythonrc.ps1()
# ps1.hooks.failure_flag = True
# result = str(ps1)
# assert result == "\x1b]633;D;1\x07\x1b]633;A\x07>>> \x1b]633;B\x07\x1b]633;C\x07"
# def test_displayhook_call():
# importlib.reload(pythonrc)
# pythonrc.ps1()
# mock_displayhook = Mock()
# hooks = pythonrc.repl_hooks()
# hooks.original_displayhook = mock_displayhook
# hooks.my_displayhook("mock_value")
# mock_displayhook.assert_called_once_with("mock_value")
# def test_excepthook_call():
# importlib.reload(pythonrc)
# pythonrc.ps1()
# mock_excepthook = Mock()
# hooks = pythonrc.repl_hooks()
# hooks.original_excepthook = mock_excepthook
# hooks.my_excepthook("mock_type", "mock_value", "mock_traceback")
# mock_excepthook.assert_called_once_with("mock_type", "mock_value", "mock_traceback")