blob: 33c8706f8418fd26edc99f3eae31d6f6fca7c23e [file] [log] [blame]
Copybara854996b2021-09-07 19:36:02 +00001# Copyright 2016 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style
3# license that can be found in the LICENSE file or at
4# https://developers.google.com/open-source/licenses/bsd
5
6"""Tests for the service_manager module."""
7from __future__ import print_function
8from __future__ import division
9from __future__ import absolute_import
10
11import unittest
12
13from features import autolink
14from services import cachemanager_svc
15from services import config_svc
16from services import features_svc
17from services import issue_svc
18from services import service_manager
19from services import project_svc
20from services import star_svc
21from services import user_svc
22from services import usergroup_svc
23
24
25class ServiceManagerTest(unittest.TestCase):
26
27 def testSetUpServices(self):
28 svcs = service_manager.set_up_services()
29 self.assertIsInstance(svcs, service_manager.Services)
30 self.assertIsInstance(svcs.autolink, autolink.Autolink)
31 self.assertIsInstance(svcs.cache_manager, cachemanager_svc.CacheManager)
32 self.assertIsInstance(svcs.user, user_svc.UserService)
33 self.assertIsInstance(svcs.user_star, star_svc.UserStarService)
34 self.assertIsInstance(svcs.project_star, star_svc.ProjectStarService)
35 self.assertIsInstance(svcs.issue_star, star_svc.IssueStarService)
36 self.assertIsInstance(svcs.project, project_svc.ProjectService)
37 self.assertIsInstance(svcs.usergroup, usergroup_svc.UserGroupService)
38 self.assertIsInstance(svcs.config, config_svc.ConfigService)
39 self.assertIsInstance(svcs.issue, issue_svc.IssueService)
40 self.assertIsInstance(svcs.features, features_svc.FeaturesService)
41
42 # Calling it again should give the same object
43 svcs2 = service_manager.set_up_services()
44 self.assertTrue(svcs is svcs2)