@@ -305,16 +305,27 @@ def test_options(self):
305
305
self .assertEqual (options .password , '123' )
306
306
self .assertEqual (options .history_file , history_file )
307
307
308
- def test_options_ignores_inline_comments (self ):
308
+ def test_options_ignores_space_prefixed_inline_comments (self ):
309
309
text = lstrip ("""
310
310
[supervisorctl]
311
- serverurl=http://localhost :9001 ;comment should not be in serverurl
311
+ serverurl=http://127.0.0.1 :9001 ; use an http:// url to specify an inet socket
312
312
""" )
313
313
instance = self ._makeOne ()
314
314
instance .configfile = StringIO (text )
315
315
instance .realize (args = [])
316
316
options = instance .configroot .supervisorctl
317
- self .assertEqual (options .serverurl , 'http://localhost:9001' )
317
+ self .assertEqual (options .serverurl , 'http://127.0.0.1:9001' )
318
+
319
+ def test_options_ignores_tab_prefixed_inline_comments (self ):
320
+ text = lstrip ("""
321
+ [supervisorctl]
322
+ serverurl=http://127.0.0.1:9001\t ;use an http:// url to specify an inet socket
323
+ """ )
324
+ instance = self ._makeOne ()
325
+ instance .configfile = StringIO (text )
326
+ instance .realize (args = [])
327
+ options = instance .configroot .supervisorctl
328
+ self .assertEqual (options .serverurl , 'http://127.0.0.1:9001' )
318
329
319
330
def test_options_parses_as_nonstrict_for_py2_py3_compat (self ):
320
331
text = lstrip ("""
@@ -692,16 +703,30 @@ def test_options(self):
692
703
self .assertEqual (instance .minfds , 2048 )
693
704
self .assertEqual (instance .minprocs , 300 )
694
705
695
- def test_options_ignores_inline_comments (self ):
706
+ def test_options_ignores_space_prefixed_inline_comments (self ):
707
+ text = lstrip ("""
708
+ [supervisord]
709
+ logfile=/var/log/supervisor/supervisord.log ;(main log file;default $CWD/supervisord.log)
710
+ minfds=123 ; (min. avail startup file descriptors;default 1024)
711
+ """ )
712
+ instance = self ._makeOne ()
713
+ instance .configfile = StringIO (text )
714
+ instance .realize (args = [])
715
+ options = instance .configroot .supervisord
716
+ self .assertEqual (options .logfile , "/var/log/supervisor/supervisord.log" )
717
+ self .assertEqual (options .minfds , 123 )
718
+
719
+ def test_options_ignores_tab_prefixed_inline_comments (self ):
696
720
text = lstrip ("""
697
721
[supervisord]
698
- identifier=foo ;comment should not be in identifier
722
+ logfile=/var/log/supervisor/supervisord.log\t ;(main log file;default $CWD/supervisord.log)
723
+ minfds=123\t ; (min. avail startup file descriptors;default 1024)
699
724
""" )
700
725
instance = self ._makeOne ()
701
726
instance .configfile = StringIO (text )
702
727
instance .realize (args = [])
703
728
options = instance .configroot .supervisord
704
- self .assertEqual (options .identifier , 'foo' )
729
+ self .assertEqual (options .minfds , 123 )
705
730
706
731
def test_options_parses_as_nonstrict_for_py2_py3_compat (self ):
707
732
text = lstrip ("""
0 commit comments