def test_mask_str2_toggle_use_fixed_mask_length(self): result = mask_sensitive_string(input_str=self.str2, use_fixed_mask_length=False) self.assertIsNotNone(result) self.assertIsInstance(result, str) self.assertEqual(len(result), len(self.str2)) self.assertFalse(self.str2 in result)
def test_mask_none_str(self): result = mask_sensitive_string(input_str=None) self.assertIsNotNone(result) self.assertIsInstance(result, str) self.assertEqual(0, len(result))
def test_mask_str1_toggle_mask_flag(self): result = mask_sensitive_string(input_str=self.str1, mask_flag=False) self.assertIsNotNone(result) self.assertIsInstance(result, str) self.assertEqual(len(result), len(self.str1)) self.assertTrue(self.str1 in result)
def test_mask_none_string_defaults(self): number = 12345 result = mask_sensitive_string(input_str=number) self.assertIsNotNone(result) self.assertIsInstance(result, str) self.assertEqual(result, self.default_mask)
def test_mask_str1_defaults(self): result = mask_sensitive_string(input_str=self.str1) self.assertIsNotNone(result) self.assertIsInstance(result, str) self.assertEqual(result, self.default_mask) self.assertFalse(self.str1 in result)