5
5
from tests .utils .plugins_cli import parse_listing
6
6
7
7
8
+ @pytest .mark .requires_installation
8
9
def test_plugins_installation (httpie_plugins_success , interface , dummy_plugin ):
9
10
lines = httpie_plugins_success ('install' , dummy_plugin .path )
10
11
assert lines [0 ].startswith (
@@ -14,6 +15,20 @@ def test_plugins_installation(httpie_plugins_success, interface, dummy_plugin):
14
15
assert interface .is_installed (dummy_plugin .name )
15
16
16
17
18
+ @pytest .mark .requires_installation
19
+ def test_plugin_installation_with_custom_config (httpie_plugins_success , interface , dummy_plugin ):
20
+ interface .environment .config ['default_options' ] = ['--session-read-only' , 'some-path.json' , 'other' , 'args' ]
21
+ interface .environment .config .save ()
22
+
23
+ lines = httpie_plugins_success ('install' , dummy_plugin .path )
24
+ assert lines [0 ].startswith (
25
+ f'Installing { dummy_plugin .path } '
26
+ )
27
+ assert f'Successfully installed { dummy_plugin .name } -{ dummy_plugin .version } ' in lines
28
+ assert interface .is_installed (dummy_plugin .name )
29
+
30
+
31
+ @pytest .mark .requires_installation
17
32
def test_plugins_listing (httpie_plugins_success , interface , dummy_plugin ):
18
33
httpie_plugins_success ('install' , dummy_plugin .path )
19
34
data = parse_listing (httpie_plugins_success ('list' ))
@@ -23,6 +38,7 @@ def test_plugins_listing(httpie_plugins_success, interface, dummy_plugin):
23
38
}
24
39
25
40
41
+ @pytest .mark .requires_installation
26
42
def test_plugins_listing_multiple (interface , httpie_plugins_success , dummy_plugins ):
27
43
paths = [plugin .path for plugin in dummy_plugins ]
28
44
httpie_plugins_success ('install' , * paths )
@@ -34,12 +50,14 @@ def test_plugins_listing_multiple(interface, httpie_plugins_success, dummy_plugi
34
50
}
35
51
36
52
53
+ @pytest .mark .requires_installation
37
54
def test_plugins_uninstall (interface , httpie_plugins_success , dummy_plugin ):
38
55
httpie_plugins_success ('install' , dummy_plugin .path )
39
56
httpie_plugins_success ('uninstall' , dummy_plugin .name )
40
57
assert not interface .is_installed (dummy_plugin .name )
41
58
42
59
60
+ @pytest .mark .requires_installation
43
61
def test_plugins_listing_after_uninstall (interface , httpie_plugins_success , dummy_plugin ):
44
62
httpie_plugins_success ('install' , dummy_plugin .path )
45
63
httpie_plugins_success ('uninstall' , dummy_plugin .name )
@@ -48,6 +66,7 @@ def test_plugins_listing_after_uninstall(interface, httpie_plugins_success, dumm
48
66
assert len (data ) == 0
49
67
50
68
69
+ @pytest .mark .requires_installation
51
70
def test_plugins_uninstall_specific (interface , httpie_plugins_success ):
52
71
new_plugin_1 = interface .make_dummy_plugin ()
53
72
new_plugin_2 = interface .make_dummy_plugin ()
@@ -61,6 +80,7 @@ def test_plugins_uninstall_specific(interface, httpie_plugins_success):
61
80
assert not interface .is_installed (target_plugin .name )
62
81
63
82
83
+ @pytest .mark .requires_installation
64
84
def test_plugins_installation_failed (httpie_plugins , interface ):
65
85
plugin = interface .make_dummy_plugin (build = False )
66
86
result = httpie_plugins ('install' , plugin .path )
@@ -69,6 +89,7 @@ def test_plugins_installation_failed(httpie_plugins, interface):
69
89
assert result .stderr .splitlines ()[- 1 ].strip ().startswith ("Can't install" )
70
90
71
91
92
+ @pytest .mark .requires_installation
72
93
def test_plugins_uninstall_non_existent (httpie_plugins , interface ):
73
94
plugin = interface .make_dummy_plugin (build = False )
74
95
result = httpie_plugins ('uninstall' , plugin .name )
@@ -80,6 +101,7 @@ def test_plugins_uninstall_non_existent(httpie_plugins, interface):
80
101
)
81
102
82
103
104
+ @pytest .mark .requires_installation
83
105
def test_plugins_double_uninstall (httpie_plugins , httpie_plugins_success , dummy_plugin ):
84
106
httpie_plugins_success ("install" , dummy_plugin .path )
85
107
httpie_plugins_success ("uninstall" , dummy_plugin .name )
@@ -93,6 +115,7 @@ def test_plugins_double_uninstall(httpie_plugins, httpie_plugins_success, dummy_
93
115
)
94
116
95
117
118
+ @pytest .mark .requires_installation
96
119
def test_plugins_upgrade (httpie_plugins , httpie_plugins_success , dummy_plugin ):
97
120
httpie_plugins_success ("install" , dummy_plugin .path )
98
121
@@ -105,6 +128,7 @@ def test_plugins_upgrade(httpie_plugins, httpie_plugins_success, dummy_plugin):
105
128
assert data [dummy_plugin .name ]['version' ] == '2.0.0'
106
129
107
130
131
+ @pytest .mark .requires_installation
108
132
def test_broken_plugins (httpie_plugins , httpie_plugins_success , dummy_plugin , broken_plugin ):
109
133
httpie_plugins_success ("install" , dummy_plugin .path , broken_plugin .path )
110
134
@@ -127,6 +151,7 @@ def test_broken_plugins(httpie_plugins, httpie_plugins_success, dummy_plugin, br
127
151
assert len (data ) == 1
128
152
129
153
154
+ @pytest .mark .requires_installation
130
155
def test_plugins_cli_error_message_without_args ():
131
156
# No arguments
132
157
result = httpie (no_debug = True )
@@ -143,6 +168,7 @@ def test_plugins_cli_error_message_without_args():
143
168
'POST pie.dev/post header:value a=b header_2:value x:=1'
144
169
]
145
170
)
171
+ @pytest .mark .requires_installation
146
172
def test_plugins_cli_error_messages_with_example (example ):
147
173
result = httpie (* example .split (), no_debug = True )
148
174
assert result .exit_status == ExitStatus .ERROR
@@ -158,6 +184,7 @@ def test_plugins_cli_error_messages_with_example(example):
158
184
'unknown.com UNPARSABLE????SYNTAX' ,
159
185
]
160
186
)
187
+ @pytest .mark .requires_installation
161
188
def test_plugins_cli_error_messages_invalid_example (example ):
162
189
result = httpie (* example .split (), no_debug = True )
163
190
assert result .exit_status == ExitStatus .ERROR
0 commit comments