@@ -48,6 +48,13 @@ def test_register_option(self):
48
48
self .assertRaises (KeyError , self .cf .register_option , 'a.b.c.d2' , 1 ,
49
49
'doc' )
50
50
51
+ # no python keywords
52
+ self .assertRaises (ValueError , self .cf .register_option , 'print' ,0 )
53
+ # must be valid identifier (ensure attribute access works)
54
+ self .assertRaises (ValueError , self .cf .register_option ,
55
+ 'Oh my Goddess!' ,0 )
56
+
57
+
51
58
# we can register options several levels deep
52
59
# without predefining the intermediate steps
53
60
# and we can define differently named options
@@ -100,11 +107,6 @@ def test_case_insensitive(self):
100
107
# testing warning with catch_warning was only added in 2.6
101
108
self .assertTrue (self .cf ._is_deprecated ('kAnBaN' ))
102
109
103
- def test_set_option (self ):
104
- self .cf .register_option ('a' , 1 , 'doc' )
105
- self .cf .register_option ('b.c' , 'hullo' , 'doc2' )
106
- self .cf .register_option ('b.b' , None , 'doc2' )
107
-
108
110
def test_get_option (self ):
109
111
self .cf .register_option ('a' , 1 , 'doc' )
110
112
self .cf .register_option ('b.c' , 'hullo' , 'doc2' )
0 commit comments