blob: 62ab43d5830b310183461a301e9ca78e3a5b5d27 [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
6# pylint: disable=protected-access
7from unittest import TestCase
8
9from data_models.transform_for_enb import bandwidth
10
11
12class TransformForMagmaTests(TestCase):
13 def test_bandwidth(self) -> None:
14 inp = 1.4
15 out = bandwidth(inp)
16 expected = 'n6'
17 self.assertEqual(out, expected, 'Should work with a float')
18
19 inp = 20
20 out = bandwidth(inp)
21 expected = 'n100'
22 self.assertEqual(out, expected, 'Should work with an int')
23
24 inp = 10
25 out = bandwidth(inp)
26 expected = 'n50'
27 self.assertEqual(out, expected, 'Should work with int 10')