@@ -39,12 +39,12 @@ def setUp(self):
3939
4040 def testApiMethodsMapped (self ):
4141 self .registry .register_backend (
42- ' {"methods": {"method1": {"rosyMethod": "foo"}}}' )
42+ {"methods" : {"method1" : {"rosyMethod" : "foo" }}})
4343 self .assertEquals ('foo' , self .registry .lookup_api_method ('method1' ))
4444
4545 def testAllApiConfigsWithTwoConfigs (self ):
46- config1 = ' {"methods": {"method1": {"rosyMethod": "c1.foo"}}}'
47- config2 = ' {"methods": {"method2": {"rosyMethod": "c2.bar"}}}'
46+ config1 = {"methods" : {"method1" : {"rosyMethod" : "c1.foo" }}}
47+ config2 = {"methods" : {"method2" : {"rosyMethod" : "c2.bar" }}}
4848 self .registry .register_backend (config1 )
4949 self .registry .register_backend (config2 )
5050 self .assertEquals ('c1.foo' , self .registry .lookup_api_method ('method1' ))
@@ -55,29 +55,24 @@ def testNoneApiConfigContent(self):
5555 self .registry .register_backend (None )
5656 self .assertIsNone (self .registry .lookup_api_method ('method' ))
5757
58- def testUnparseableApiConfigContent (self ):
59- config = '{"methods": {"method": {"rosyMethod": "foo"' # Unclosed {s
60- self .assertRaises (ValueError , self .registry .register_backend , config )
61- self .assertIsNone (self .registry .lookup_api_method ('method' ))
62-
6358 def testEmptyApiConfig (self ):
64- config = '{}'
59+ config = {}
6560 self .registry .register_backend (config )
6661 self .assertIsNone (self .registry .lookup_api_method ('method' ))
6762
6863 def testApiConfigContentWithNoMethods (self ):
69- config = ' {"methods": {}}'
64+ config = {"methods" : {}}
7065 self .registry .register_backend (config )
7166 self .assertIsNone (self .registry .lookup_api_method ('method' ))
7267
7368 def testApiConfigContentWithNoRosyMethod (self ):
74- config = ' {"methods": {"method": {}}}'
69+ config = {"methods" : {"method" : {}}}
7570 self .registry .register_backend (config )
7671 self .assertIsNone (self .registry .lookup_api_method ('method' ))
7772
7873 def testRegisterSpiRootRepeatedError (self ):
79- config1 = ' {"methods": {"method1": {"rosyMethod": "MyClass.Func1"}}}'
80- config2 = ' {"methods": {"method2": {"rosyMethod": "MyClass.Func2"}}}'
74+ config1 = {"methods" : {"method1" : {"rosyMethod" : "MyClass.Func1" }}}
75+ config2 = {"methods" : {"method2" : {"rosyMethod" : "MyClass.Func2" }}}
8176 self .registry .register_backend (config1 )
8277 self .assertRaises (api_exceptions .ApiConfigurationError ,
8378 self .registry .register_backend , config2 )
@@ -88,9 +83,9 @@ def testRegisterSpiRootRepeatedError(self):
8883
8984 def testRegisterSpiDifferentClasses (self ):
9085 """This can happen when multiple classes implement an API."""
91- config1 = ( ' {"methods": {'
92- ' "method1": {"rosyMethod": "MyClass.Func1"},'
93- ' "method2": {"rosyMethod": "OtherClass.Func2"}}}' )
86+ config1 = {"methods" : {
87+ "method1" : {"rosyMethod" : "MyClass.Func1" },
88+ "method2" : {"rosyMethod" : "OtherClass.Func2" }}}
9489 self .registry .register_backend (config1 )
9590 self .assertEquals ('MyClass.Func1' ,
9691 self .registry .lookup_api_method ('method1' ))
0 commit comments