示例#1
0
 def test_cast_truish_to_boolean(self):
     self.assertEqual(
         cast_to_boolean(-1, IntegerType(), options=BASE_OPTIONS), True)
示例#2
0
 def test_cast_falsish_to_boolean(self):
     self.assertEqual(
         cast_to_boolean(0, IntegerType(), options=BASE_OPTIONS), False)
示例#3
0
 def test_cast_empty_string_to_boolean(self):
     self.assertEqual(
         cast_to_boolean("", StringType(), options=BASE_OPTIONS), None)
示例#4
0
 def test_cast_random_string_to_boolean(self):
     self.assertEqual(
         cast_to_boolean("pysparkling", StringType(), options=BASE_OPTIONS),
         None)
示例#5
0
 def test_cast_false_to_boolean(self):
     self.assertEqual(
         cast_to_boolean("FalsE", StringType(), options=BASE_OPTIONS),
         False)
示例#6
0
 def test_cast_true_to_boolean(self):
     self.assertEqual(
         cast_to_boolean("TrUe", StringType(), options=BASE_OPTIONS), True)