blob: 8b2f2faf0e657a2a620be59df232a443d688fd72 [file] [log] [blame]
Wei-Yu Chenad55cb82022-02-15 20:07:01 +08001# SPDX-FileCopyrightText: 2020 The Magma Authors.
2# SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org>
3#
4# SPDX-License-Identifier: BSD-3-Clause
Wei-Yu Chen49950b92021-11-08 19:19:18 +08005
6from unittest import TestCase, mock
7
8import magma.enodebd.tests.test_utils.mock_functions as enb_mock
9
10
11class EnodebHandlerTestCase(TestCase):
12 """
13 Sets up test class with a set of patches needed for eNodeB handlers
14 """
15
16 def setUp(self):
17 self.patches = {
18 enb_mock.GET_IP_FROM_IF_PATH:
19 mock.Mock(side_effect=enb_mock.mock_get_ip_from_if),
20 enb_mock.LOAD_SERVICE_MCONFIG_PATH:
21 mock.Mock(
22 side_effect=enb_mock.mock_load_service_mconfig_as_json,
23 ),
24 }
25 self.applied_patches = [
26 mock.patch(patch, data) for patch, data in
27 self.patches.items()
28 ]
29 for patch in self.applied_patches:
30 patch.start()
31 self.addCleanup(mock.patch.stopall)