Example #1
0
 def test_validate_string_contains_at_least_one_space(self):
     result = validate_string(input_str=' {}'.format(self.short_str),
                              contain_at_least_one_space=True,
                              start_with_alpha=False)
     self.assertIsNotNone(result)
     self.assertIsInstance(result, bool)
     self.assertTrue(result)
Example #2
0
 def test_validate_string_does_not_start_with_alpha_but_with_space(self):
     result = validate_string(input_str=' {}'.format(self.short_str),
                              start_with_alpha=True)
     self.assertIsNotNone(result)
     self.assertIsInstance(result, bool)
     self.assertFalse(result)
Example #3
0
 def test_validate_string_fail_to_contain_at_least_one_space(self):
     result = validate_string(input_str=self.short_str,
                              contain_at_least_one_space=True)
     self.assertIsNotNone(result)
     self.assertIsInstance(result, bool)
     self.assertFalse(result)
Example #4
0
 def test_validate_string_greater_than_maximum_len(self):
     result = validate_string(input_str=self.short_str,
                              max_length=len(self.short_str) - 1)
     self.assertIsNotNone(result)
     self.assertIsInstance(result, bool)
     self.assertFalse(result)
Example #5
0
 def test_validate_string_less_than_minimum_len(self):
     result = validate_string(input_str=self.short_str,
                              min_length=len(self.short_str) + 1)
     self.assertIsNotNone(result)
     self.assertIsInstance(result, bool)
     self.assertFalse(result)
Example #6
0
 def test_validate_string_not_a_string_instance(self):
     result = validate_string(input_str=[1, 2])
     self.assertIsNotNone(result)
     self.assertIsInstance(result, bool)
     self.assertFalse(result)
Example #7
0
 def test_validate_string_can_not_be_none_and_is_none(self):
     result = validate_string(input_str=None)
     self.assertIsNotNone(result)
     self.assertIsInstance(result, bool)
     self.assertFalse(result)
Example #8
0
 def test_validate_string_short_str_defaults(self):
     result = validate_string(input_str=self.short_str)
     self.assertIsNotNone(result)
     self.assertIsInstance(result, bool)
     self.assertTrue(result)