def test_tohertzStrfgHz(self): out = machinestate.tohertz("1234.00gHz") self.assertEqual(out, 1234000000000)
def test_tohertzStrNotValid(self): out = machinestate.tohertz("abc") self.assertEqual(out, None)
def test_tohertzStrfhz(self): out = machinestate.tohertz("1234.00hz") self.assertEqual(out, 1234)
def test_tohertzFloatStr(self): # string without unit are seen as kHz out = machinestate.tohertz("10000.00") self.assertEqual(out, 10000000)
def test_tohertzFloat(self): out = machinestate.tohertz(1000.00) self.assertEqual(out, 1000)
def test_tohertzStrKHz(self): out = machinestate.tohertz("1234KHz") self.assertEqual(out, 1234*1000)
def test_tohertzNone(self): out = machinestate.tohertz(None) self.assertEqual(out, None)