blob: bcc19fac9a878a975565b3c2cf1a1a98500a875a [file] [log] [blame]
Wei-Yu Chen49950b92021-11-08 19:19:18 +08001"""
2Copyright 2020 The Magma Authors.
3
4This source code is licensed under the BSD-style license found in the
5LICENSE file in the root directory of this source tree.
6
7Unless required by applicable law or agreed to in writing, software
8distributed under the License is distributed on an "AS IS" BASIS,
9WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10See the License for the specific language governing permissions and
11limitations under the License.
12"""
13
14# pylint: disable=protected-access
15from unittest import TestCase
16
17from data_models.transform_for_enb import bandwidth
18
19
20class TransformForMagmaTests(TestCase):
21 def test_bandwidth(self) -> None:
22 inp = 1.4
23 out = bandwidth(inp)
24 expected = 'n6'
25 self.assertEqual(out, expected, 'Should work with a float')
26
27 inp = 20
28 out = bandwidth(inp)
29 expected = 'n100'
30 self.assertEqual(out, expected, 'Should work with an int')
31
32 inp = 10
33 out = bandwidth(inp)
34 expected = 'n50'
35 self.assertEqual(out, expected, 'Should work with int 10')