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