5
5
import signal
6
6
import sys
7
7
import unittest
8
- from supervisor .compat import resource_file
8
+ from supervisor .compat import resource_filename
9
9
from supervisor .compat import xmlrpclib
10
10
from supervisor .xmlrpc import SupervisorTransport
11
11
@@ -25,7 +25,7 @@ def test_issue_291a_percent_signs_in_original_env_are_preserved(self):
25
25
passed to the child without the percent sign being mangled."""
26
26
key = "SUPERVISOR_TEST_1441B"
27
27
val = "foo_%s_%_%%_%%%_%2_bar"
28
- filename = resource_file (__package__ , 'fixtures/issue-291a.conf' )
28
+ filename = resource_filename (__package__ , 'fixtures/issue-291a.conf' )
29
29
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
30
30
try :
31
31
os .environ [key ] = val
@@ -38,7 +38,7 @@ def test_issue_291a_percent_signs_in_original_env_are_preserved(self):
38
38
def test_issue_550 (self ):
39
39
"""When an environment variable is set in the [supervisord] section,
40
40
it should be put into the environment of the subprocess."""
41
- filename = resource_file (__package__ , 'fixtures/issue-550.conf' )
41
+ filename = resource_filename (__package__ , 'fixtures/issue-550.conf' )
42
42
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
43
43
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
44
44
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -54,7 +54,7 @@ def test_issue_550(self):
54
54
def test_issue_565 (self ):
55
55
"""When a log file has Unicode characters in it, 'supervisorctl
56
56
tail -f name' should still work."""
57
- filename = resource_file (__package__ , 'fixtures/issue-565.conf' )
57
+ filename = resource_filename (__package__ , 'fixtures/issue-565.conf' )
58
58
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
59
59
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
60
60
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -71,7 +71,7 @@ def test_issue_565(self):
71
71
def test_issue_638 (self ):
72
72
"""When a process outputs something on its stdout or stderr file
73
73
descriptor that is not valid UTF-8, supervisord should not crash."""
74
- filename = resource_file (__package__ , 'fixtures/issue-638.conf' )
74
+ filename = resource_filename (__package__ , 'fixtures/issue-638.conf' )
75
75
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
76
76
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
77
77
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -90,7 +90,7 @@ def test_issue_638(self):
90
90
def test_issue_663 (self ):
91
91
"""When Supervisor is run on Python 3, the eventlistener protocol
92
92
should work."""
93
- filename = resource_file (__package__ , 'fixtures/issue-663.conf' )
93
+ filename = resource_filename (__package__ , 'fixtures/issue-663.conf' )
94
94
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
95
95
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
96
96
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -102,7 +102,7 @@ def test_issue_664(self):
102
102
"""When a subprocess name has Unicode characters, 'supervisord'
103
103
should not send incomplete XML-RPC responses and 'supervisorctl
104
104
status' should work."""
105
- filename = resource_file (__package__ , 'fixtures/issue-664.conf' )
105
+ filename = resource_filename (__package__ , 'fixtures/issue-664.conf' )
106
106
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
107
107
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
108
108
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -121,7 +121,7 @@ def test_issue_664(self):
121
121
def test_issue_733 (self ):
122
122
"""When a subprocess enters the FATAL state, a one-line eventlistener
123
123
can be used to signal supervisord to shut down."""
124
- filename = resource_file (__package__ , 'fixtures/issue-733.conf' )
124
+ filename = resource_filename (__package__ , 'fixtures/issue-733.conf' )
125
125
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
126
126
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
127
127
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -130,7 +130,7 @@ def test_issue_733(self):
130
130
supervisord .expect (pexpect .EOF )
131
131
132
132
def test_issue_835 (self ):
133
- filename = resource_file (__package__ , 'fixtures/issue-835.conf' )
133
+ filename = resource_filename (__package__ , 'fixtures/issue-835.conf' )
134
134
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
135
135
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
136
136
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -146,7 +146,7 @@ def test_issue_835(self):
146
146
transport .connection .close ()
147
147
148
148
def test_issue_836 (self ):
149
- filename = resource_file (__package__ , 'fixtures/issue-836.conf' )
149
+ filename = resource_filename (__package__ , 'fixtures/issue-836.conf' )
150
150
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
151
151
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
152
152
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -169,7 +169,7 @@ def test_issue_836(self):
169
169
def test_issue_986_command_string_with_double_percent (self ):
170
170
"""A percent sign can be used in a command= string without being
171
171
expanded if it is escaped by a second percent sign."""
172
- filename = resource_file (__package__ , 'fixtures/issue-986.conf' )
172
+ filename = resource_filename (__package__ , 'fixtures/issue-986.conf' )
173
173
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
174
174
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
175
175
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -178,7 +178,7 @@ def test_issue_986_command_string_with_double_percent(self):
178
178
def test_issue_1054 (self ):
179
179
"""When run on Python 3, the 'supervisorctl avail' command
180
180
should work."""
181
- filename = resource_file (__package__ , 'fixtures/issue-1054.conf' )
181
+ filename = resource_filename (__package__ , 'fixtures/issue-1054.conf' )
182
182
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
183
183
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
184
184
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -196,7 +196,7 @@ def test_issue_1170a(self):
196
196
"""When the [supervisord] section has a variable defined in
197
197
environment=, that variable should be able to be used in an
198
198
%(ENV_x) expansion in a [program] section."""
199
- filename = resource_file (__package__ , 'fixtures/issue-1170a.conf' )
199
+ filename = resource_filename (__package__ , 'fixtures/issue-1170a.conf' )
200
200
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
201
201
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
202
202
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -207,7 +207,7 @@ def test_issue_1170b(self):
207
207
environment=, and a variable by the same name is defined in
208
208
enviroment= of a [program] section, the one in the [program]
209
209
section should be used."""
210
- filename = resource_file (__package__ , 'fixtures/issue-1170b.conf' )
210
+ filename = resource_filename (__package__ , 'fixtures/issue-1170b.conf' )
211
211
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
212
212
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
213
213
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -218,7 +218,7 @@ def test_issue_1170c(self):
218
218
environment=, and a variable by the same name is defined in
219
219
enviroment= of an [eventlistener] section, the one in the
220
220
[eventlistener] section should be used."""
221
- filename = resource_file (__package__ , 'fixtures/issue-1170c.conf' )
221
+ filename = resource_filename (__package__ , 'fixtures/issue-1170c.conf' )
222
222
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
223
223
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
224
224
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -229,7 +229,7 @@ def test_issue_1224(self):
229
229
then the non-rotating logger will be used to avoid an
230
230
IllegalSeekError in the case that the user has configured a
231
231
non-seekable file like /dev/stdout."""
232
- filename = resource_file (__package__ , 'fixtures/issue-1224.conf' )
232
+ filename = resource_filename (__package__ , 'fixtures/issue-1224.conf' )
233
233
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
234
234
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
235
235
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -238,7 +238,7 @@ def test_issue_1224(self):
238
238
def test_issue_1231a (self ):
239
239
"""When 'supervisorctl tail -f name' is run and the log contains
240
240
unicode, it should not fail."""
241
- filename = resource_file (__package__ , 'fixtures/issue-1231a.conf' )
241
+ filename = resource_filename (__package__ , 'fixtures/issue-1231a.conf' )
242
242
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
243
243
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
244
244
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -255,7 +255,7 @@ def test_issue_1231a(self):
255
255
def test_issue_1231b (self ):
256
256
"""When 'supervisorctl tail -f name' is run and the log contains
257
257
unicode, it should not fail."""
258
- filename = resource_file (__package__ , 'fixtures/issue-1231b.conf' )
258
+ filename = resource_filename (__package__ , 'fixtures/issue-1231b.conf' )
259
259
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
260
260
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
261
261
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -289,7 +289,7 @@ def test_issue_1231b(self):
289
289
def test_issue_1231c (self ):
290
290
"""When 'supervisorctl tail -f name' is run and the log contains
291
291
unicode, it should not fail."""
292
- filename = resource_file (__package__ , 'fixtures/issue-1231c.conf' )
292
+ filename = resource_filename (__package__ , 'fixtures/issue-1231c.conf' )
293
293
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
294
294
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
295
295
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -331,7 +331,7 @@ def test_issue_1298(self):
331
331
"""When the output of 'supervisorctl tail -f worker' is piped such as
332
332
'supervisor tail -f worker | grep something', 'supervisorctl' should
333
333
not crash."""
334
- filename = resource_file (__package__ , 'fixtures/issue-1298.conf' )
334
+ filename = resource_filename (__package__ , 'fixtures/issue-1298.conf' )
335
335
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
336
336
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
337
337
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -365,7 +365,7 @@ def test_issue_1418_pidproxy_cmd_with_args(self):
365
365
def test_issue_1483a_identifier_default (self ):
366
366
"""When no identifier is supplied on the command line or in the config
367
367
file, the default is used."""
368
- filename = resource_file (__package__ , 'fixtures/issue-1483a.conf' )
368
+ filename = resource_filename (__package__ , 'fixtures/issue-1483a.conf' )
369
369
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
370
370
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
371
371
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -384,7 +384,7 @@ def test_issue_1483a_identifier_default(self):
384
384
def test_issue_1483b_identifier_from_config_file (self ):
385
385
"""When the identifier is supplied in the config file only, that
386
386
identifier is used instead of the default."""
387
- filename = resource_file (__package__ , 'fixtures/issue-1483b.conf' )
387
+ filename = resource_filename (__package__ , 'fixtures/issue-1483b.conf' )
388
388
args = ['-m' , 'supervisor.supervisord' , '-c' , filename ]
389
389
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
390
390
self .addCleanup (supervisord .kill , signal .SIGINT )
@@ -403,7 +403,7 @@ def test_issue_1483b_identifier_from_config_file(self):
403
403
def test_issue_1483c_identifier_from_command_line (self ):
404
404
"""When an identifier is supplied in both the config file and on the
405
405
command line, the one from the command line is used."""
406
- filename = resource_file (__package__ , 'fixtures/issue-1483c.conf' )
406
+ filename = resource_filename (__package__ , 'fixtures/issue-1483c.conf' )
407
407
args = ['-m' , 'supervisor.supervisord' , '-c' , filename , '-i' , 'from_command_line' ]
408
408
supervisord = pexpect .spawn (sys .executable , args , encoding = 'utf-8' )
409
409
self .addCleanup (supervisord .kill , signal .SIGINT )
0 commit comments