tests,stdlib,python: Add tests for base 10 to 2 SI unit check

**Note**: Erin needs to complete the commit by expanding this test to
properly test the behavior of this change.

To run the pyunit tests:

```sh
scons build/ALL/gem5.opt -j`nproc`
./build/ALL/gem5.opt tests/run_pyunit.py
```

Change-Id: I8cea0fe8b088e03e84072a000444953768bc3151
This commit is contained in:
Bobby R. Bruce
2024-09-07 06:35:09 -07:00
committed by Erin Le
parent 00f927a4e2
commit f327559ca4
2 changed files with 27 additions and 3 deletions

View File

@@ -277,3 +277,11 @@ class ConvertTestSuite(unittest.TestCase):
self.assertRaises(ValueError, conv, "-1K")
self.assertEqual(conv("32F"), 273.15)
def test_base_10_to_2(self):
conv = convert._base_10_to_2
self.assertEqual(conv("1k"), "1Ki")
self.assertIsNone(conv("1Ki"))
# Leaving the rest of this test for Erin to finish.