コード例 #1
0
 def test_cast_off(self):
     val = global_status._cast('OFF')
     assert not val and isinstance(val, bool)
コード例 #2
0
 def test_cast_string(self):
     val = global_status._cast('something')
     assert val == 'something'
コード例 #3
0
 def test_cast_float(self):
     val = global_status._cast('1.0')
     assert val == 1.0 and isinstance(val, float)
コード例 #4
0
 def test_cast_on(self):
     val = global_status._cast('ON')
     assert val and isinstance(val, bool)
コード例 #5
0
 def test_cast_string(self):
     val = global_status._cast('something')
     assert val == 'something'
コード例 #6
0
 def test_cast_int(self):
     val = global_status._cast('1')
     assert val == 1 and isinstance(val, int)
コード例 #7
0
 def test_cast_off(self):
     val = global_status._cast('OFF')
     assert not val and isinstance(val, bool)
コード例 #8
0
 def test_cast_on(self):
     val = global_status._cast('ON')
     assert val and isinstance(val, bool)
コード例 #9
0
 def test_cast_float(self):
     val = global_status._cast('1.0')
     assert val == 1.0 and isinstance(val, float)
コード例 #10
0
 def test_cast_int(self):
     val = global_status._cast('1')
     assert val == 1 and isinstance(val, int)
コード例 #11
0
 def test_cast_string(self):
     val = global_status._cast("something")
     assert val == "something"