feat(py-monitor): add test_core.py()
This commit is contained in:
1 parent
6be65312b0
commit
0ac7456989
1 file changed
+8
@@ -37,6 +37,14 @@ class PriceTests(unittest.TestCase):
|
||||
def test_parses_thousands_separator(self):
|
||||
self.assertEqual(1250.5, parse_price("RM 1,250.50"))
|
||||
|
||||
def test_parses_foreign_currency_prefix(self):
|
||||
self.assertEqual(12.0, parse_price("S$ 12"))
|
||||
|
||||
def test_returns_none_for_text(self):
|
||||
self.assertIsNone(parse_price("Free"))
|
||||
self.assertIsNone(parse_price(""))
|
||||
self.assertIsNone(parse_price(None))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user