示例#1
0
 def test_tointlistValidRange(self):
     out = machinestate.tointlist("1-3")
     self.assertEqual(out, [1, 2, 3])
示例#2
0
 def test_tointlistValidMixed(self):
     out = machinestate.tointlist("1-3,4")
     self.assertEqual(out, [1, 2, 3, 4])
示例#3
0
 def test_tointlistValidFloats(self):
     out = machinestate.tointlist("1.0 2.0 3.0")
     self.assertEqual(out, [1, 2, 3])
示例#4
0
 def test_tointlistValidComma(self):
     out = machinestate.tointlist("1,2,3")
     self.assertEqual(out, [1, 2, 3])
示例#5
0
 def test_tointlistValidTabs(self):
     out = machinestate.tointlist("1\t2\t3")
     self.assertEqual(out, [1, 2, 3])
示例#6
0
 def test_tointlistValidSpaces(self):
     out = machinestate.tointlist("1 2 3")
     self.assertEqual(out, [1, 2, 3])
示例#7
0
 def test_tointlistFloat(self):
     out = machinestate.tointlist(1.0)
     self.assertEqual(out, [1])
示例#8
0
 def test_tointlistInt(self):
     out = machinestate.tointlist(1)
     self.assertEqual(out, [1])
示例#9
0
 def test_tointlistNone(self):
     out = machinestate.tointlist(None)
     self.assertEqual(out, None)