77
88
99class ServiceParserTest (unittest .TestCase ):
10+ SERVICE_NAME = "jenkins"
11+ SERVICE_DOMAIN = "jenkins.bnndemos.com"
12+
1013 def test_parse_web_service (self ):
1114 s : Service = Service .Schema ().loads (open ("tests/data/service_web.json" ).read ())
1215 self .assertEqual (API_VERSION , s .apiVersion )
13- self .assertEqual ("*.staging.earnest.com" , s .metadata .name )
16+ self .assertEqual (ServiceParserTest .SERVICE_NAME , s .metadata .name )
17+ self .assertEqual (ServiceParserTest .SERVICE_DOMAIN , s .metadata .tags .domain )
1418 self .assertEqual (Tags .TEMPLATE_WEB , s .metadata .tags .template )
1519 self .assertEqual (Tags .APP_TYPE_WEB , s .metadata .tags .service_app_type )
1620
1721 def test_parse_info (self ):
1822 i : ServiceInfo = ServiceInfo .Schema ().loads (open ("tests/data/serviceinfo.json" ).read ())
19- self .assertEqual ("*.staging.earnest.com" , i .service_name )
20- self .assertEqual ("*.staging.earnest.com" , i .service .name )
23+ self .assertEqual (ServiceParserTest . SERVICE_NAME , i .service_name )
24+ self .assertEqual (ServiceParserTest . SERVICE_NAME , i .service .name )
2125
2226 def test_parse_attachments (self ):
2327 a : List [Attachment ] = Attachment .Schema ().loads (open ("tests/data/attachments.json" ).read (), many = True )
@@ -32,6 +36,6 @@ def test_parse_attachments(self):
3236class TagParserTest (unittest .TestCase ):
3337 def test_parse_tags (self ):
3438 t : Tags = Tags .Schema ().loads (open ("tests/data/service_tags.json" ).read ())
35- self .assertEqual ("*.staging.earnest.com" , t .domain )
39+ self .assertEqual (ServiceParserTest . SERVICE_DOMAIN , t .domain )
3640 self .assertEqual (Tags .TEMPLATE_WEB , t .template )
3741 self .assertEqual (Tags .APP_TYPE_WEB , t .service_app_type )
0 commit comments