@@ -307,16 +307,27 @@ def test_options(self):
307
307
self .assertEqual (options .password , '123' )
308
308
self .assertEqual (options .history_file , history_file )
309
309
310
- def test_options_ignores_inline_comments (self ):
310
+ def test_options_ignores_space_prefixed_inline_comments (self ):
311
311
text = lstrip ("""
312
312
[supervisorctl]
313
- serverurl=http://localhost :9001 ;comment should not be in serverurl
313
+ serverurl=http://127.0.0.1 :9001 ; use an http:// url to specify an inet socket
314
314
""" )
315
315
instance = self ._makeOne ()
316
316
instance .configfile = StringIO (text )
317
317
instance .realize (args = [])
318
318
options = instance .configroot .supervisorctl
319
- self .assertEqual (options .serverurl , 'http://localhost:9001' )
319
+ self .assertEqual (options .serverurl , 'http://127.0.0.1:9001' )
320
+
321
+ def test_options_ignores_tab_prefixed_inline_comments (self ):
322
+ text = lstrip ("""
323
+ [supervisorctl]
324
+ serverurl=http://127.0.0.1:9001\t ;use an http:// url to specify an inet socket
325
+ """ )
326
+ instance = self ._makeOne ()
327
+ instance .configfile = StringIO (text )
328
+ instance .realize (args = [])
329
+ options = instance .configroot .supervisorctl
330
+ self .assertEqual (options .serverurl , 'http://127.0.0.1:9001' )
320
331
321
332
def test_options_parses_as_nonstrict_for_py2_py3_compat (self ):
322
333
text = lstrip ("""
@@ -666,16 +677,30 @@ def test_options(self):
666
677
self .assertEqual (instance .minfds , 2048 )
667
678
self .assertEqual (instance .minprocs , 300 )
668
679
669
- def test_options_ignores_inline_comments (self ):
680
+ def test_options_ignores_space_prefixed_inline_comments (self ):
681
+ text = lstrip ("""
682
+ [supervisord]
683
+ logfile=/var/log/supervisor/supervisord.log ;(main log file;default $CWD/supervisord.log)
684
+ minfds=123 ; (min. avail startup file descriptors;default 1024)
685
+ """ )
686
+ instance = self ._makeOne ()
687
+ instance .configfile = StringIO (text )
688
+ instance .realize (args = [])
689
+ options = instance .configroot .supervisord
690
+ self .assertEqual (options .logfile , "/var/log/supervisor/supervisord.log" )
691
+ self .assertEqual (options .minfds , 123 )
692
+
693
+ def test_options_ignores_tab_prefixed_inline_comments (self ):
670
694
text = lstrip ("""
671
695
[supervisord]
672
- identifier=foo ;comment should not be in identifier
696
+ logfile=/var/log/supervisor/supervisord.log\t ;(main log file;default $CWD/supervisord.log)
697
+ minfds=123\t ; (min. avail startup file descriptors;default 1024)
673
698
""" )
674
699
instance = self ._makeOne ()
675
700
instance .configfile = StringIO (text )
676
701
instance .realize (args = [])
677
702
options = instance .configroot .supervisord
678
- self .assertEqual (options .identifier , 'foo' )
703
+ self .assertEqual (options .minfds , 123 )
679
704
680
705
def test_options_parses_as_nonstrict_for_py2_py3_compat (self ):
681
706
text = lstrip ("""
0 commit comments