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