Wei-Yu Chen | ad55cb8 | 2022-02-15 20:07:01 +0800 | [diff] [blame] | 1 | # 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 Chen | 49950b9 | 2021-11-08 19:19:18 +0800 | [diff] [blame] | 5 | |
| 6 | # pylint: disable=protected-access |
| 7 | from unittest import TestCase |
| 8 | |
| 9 | from data_models.transform_for_enb import bandwidth |
| 10 | |
| 11 | |
| 12 | class 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') |