@@ -32,90 +32,61 @@ def test_config_rest(self):
3232 config = ApiGatewayConfig (path = self .config_file_path )
3333 rest = config .rest
3434
35- broker = rest .connection
36- self .assertEqual ("localhost" , broker .host )
37- self .assertEqual (55909 , broker .port )
35+ self .assertEqual ("localhost" , rest .host )
36+ self .assertEqual (55909 , rest .port )
3837
3938 def test_config_discovery (self ):
4039 config = ApiGatewayConfig (path = self .config_file_path )
4140 discovery = config .discovery
4241
43- conn = discovery .connection
44- self .assertEqual ("localhost" , conn .host )
45- self .assertEqual (5567 , conn .port )
46-
47- db = discovery .database
48- self .assertEqual ("localhost" , db .host )
49- self .assertEqual (6379 , db .port )
50- self .assertEqual (None , db .password )
51-
52- self .assertEqual ("" , discovery .connection .path )
42+ self .assertEqual ("localhost" , discovery .host )
43+ self .assertEqual (5567 , discovery .port )
5344
5445 def test_config_cors (self ):
5546 config = ApiGatewayConfig (path = self .config_file_path )
56- cors = config .cors
47+ cors = config .rest . cors
5748
5849 self .assertIsInstance (cors .enabled , bool )
5950 self .assertFalse (cors .enabled )
6051
6152 @mock .patch .dict (os .environ , {"DISCOVERY_SERVICE_HOST" : "::1" })
6253 def test_overwrite_with_environment_discovery_host (self ):
6354 config = ApiGatewayConfig (path = self .config_file_path )
64- conn = config .discovery .connection
65- self .assertEqual ("::1" , conn .host )
55+ self .assertEqual ("::1" , config .discovery .host )
6656
6757 @mock .patch .dict (os .environ , {"DISCOVERY_SERVICE_PORT" : "4040" })
6858 def test_overwrite_with_environment_discovery_port (self ):
6959 config = ApiGatewayConfig (path = self .config_file_path )
70- conn = config .discovery .connection
71- self .assertEqual (4040 , conn .port )
72-
73- @mock .patch .dict (os .environ , {"DISCOVERY_SERVICE_DB_HOST" : "::1" })
74- def test_overwrite_with_environment_discovery_db_host (self ):
75- config = ApiGatewayConfig (path = self .config_file_path )
76- conn = config .discovery .database
77- self .assertEqual ("::1" , conn .host )
78-
79- @mock .patch .dict (os .environ , {"DISCOVERY_SERVICE_DB_PORT" : "3030" })
80- def test_overwrite_with_environment_discovery_db_port (self ):
81- config = ApiGatewayConfig (path = self .config_file_path )
82- conn = config .discovery .database
83- self .assertEqual (3030 , conn .port )
84-
85- @mock .patch .dict (os .environ , {"DISCOVERY_SERVICE_DB_PASSWORD" : "1234" })
86- def test_overwrite_with_environment_discovery_db_password (self ):
87- config = ApiGatewayConfig (path = self .config_file_path )
88- conn = config .discovery .database
89- self .assertEqual ("1234" , conn .password )
60+ self .assertEqual (4040 , config .discovery .port )
9061
9162 @mock .patch .dict (os .environ , {"API_GATEWAY_REST_HOST" : "::1" })
9263 def test_overwrite_with_environment (self ):
9364 config = ApiGatewayConfig (path = self .config_file_path )
9465 rest = config .rest
95- self .assertEqual ("::1" , rest .connection . host )
66+ self .assertEqual ("::1" , rest .host )
9667
9768 @mock .patch .dict (os .environ , {"API_GATEWAY_REST_HOST" : "::1" })
9869 def test_overwrite_with_environment_false (self ):
9970 config = ApiGatewayConfig (path = self .config_file_path , with_environment = False )
10071 rest = config .rest
101- self .assertEqual ("localhost" , rest .connection . host )
72+ self .assertEqual ("localhost" , rest .host )
10273
103- @mock .patch .dict (os .environ , {"API_GATEWAY_CORS_ENABLED " : "false" })
74+ @mock .patch .dict (os .environ , {"API_GATEWAY_REST_CORS_ENABLED " : "false" })
10475 def test_overwrite_with_environment_cors (self ):
10576 config = ApiGatewayConfig (path = self .config_file_path )
106- cors = config .cors
77+ cors = config .rest . cors
10778
10879 self .assertIsInstance (cors .enabled , bool )
10980 self .assertFalse (cors .enabled )
11081
11182 def test_overwrite_with_parameter (self ):
11283 config = ApiGatewayConfig (path = self .config_file_path , api_gateway_rest_host = "::1" )
11384 rest = config .rest
114- self .assertEqual ("::1" , rest .connection . host )
85+ self .assertEqual ("::1" , rest .host )
11586
11687 def test_overwrite_with_parameter_cors (self ):
117- config = ApiGatewayConfig (path = self .config_file_path , api_gateway_cors_enabled = False )
118- cors = config .cors
88+ config = ApiGatewayConfig (path = self .config_file_path , api_gateway_rest_cors_enabled = False )
89+ cors = config .rest . cors
11990
12091 self .assertIsInstance (cors .enabled , bool )
12192 self .assertFalse (cors .enabled )
0 commit comments