Exemplo n.º 1
0
    def bool(self, index, default=False):

        value = self.value(index)

        if value is None:
            value = default
        elif strutils.startswith_ignore_case(value, "y"):
            return True
        elif strutils.startswith_ignore_case(value, "t"):
            return True
        else:
            return False
Exemplo n.º 2
0
 def bool(self, index, default=False):
     
     value = self.value(index)
     
     if value is None:
         value = default
     elif strutils.startswith_ignore_case(value, 'y'):
         return True
     elif strutils.startswith_ignore_case(value, 't'):
         return True
     else:
         return False
Exemplo n.º 3
0
 def test_startswith_ignore_case_none(self):
     
     result = strutils.startswith_ignore_case(None, "Main String is None.")
     self.assertFalse(result, 'Expected false match.')
Exemplo n.º 4
0
 def test_startswith_ignore_case_mismatch(self):
     
     result = strutils.startswith_ignore_case("Start Mismatch 12345", "No Start")
     self.assertFalse(result, 'Expected false match.')
Exemplo n.º 5
0
 def test_startswith_ignore_case_match(self):
     
     result = strutils.startswith_ignore_case("Start12345", "start")
     self.assertTrue(result, 'Expected true match.')
Exemplo n.º 6
0
    def test_startswith_ignore_case_none(self):

        result = strutils.startswith_ignore_case(None, "Main String is None.")
        self.assertFalse(result, 'Expected false match.')
Exemplo n.º 7
0
    def test_startswith_ignore_case_mismatch(self):

        result = strutils.startswith_ignore_case("Start Mismatch 12345",
                                                 "No Start")
        self.assertFalse(result, 'Expected false match.')
Exemplo n.º 8
0
    def test_startswith_ignore_case_match(self):

        result = strutils.startswith_ignore_case("Start12345", "start")
        self.assertTrue(result, 'Expected true match.')