示例#1
0
 def test_hyphen(self):
     """
     Test case for a name with an asterisk.
     """
     try:
         db_name_validator('logstash-')
     except ValidationError:
         self.fail('Name raised ValidationError unexpectedly')
示例#2
0
 def test_underscore(self):
     """
     Test case for a name that contains an underscore.
     """
     try:
         db_name_validator('logstash_')
     except ValidationError:
         self.fail('Name raised ValidationError unexpectedly')
示例#3
0
 def test_ends_with_dollar_sign(self):
     """
     Test case for a name that ends with '$'.
     """
     try:
         db_name_validator('id$')
     except ValidationError:
         self.fail('Name raised ValidationError unexpectedly')
示例#4
0
 def test_period(self):
     """
     Test case for a name with a period.
     """
     with self.assertRaises(ValidationError):
         db_name_validator('http.log')
示例#5
0
 def test_white_space(self):
     """
     Test case for a name with a space.
     """
     with self.assertRaises(ValidationError):
         db_name_validator('http log')
示例#6
0
 def test_at_sign(self):
     """
     Test case for a field name with an 'at' sign.
     """
     with self.assertRaises(ValidationError):
         db_name_validator('@timestamp')
示例#7
0
 def test_asterisk(self):
     """
     Test case for a name with an asterisk.
     """
     with self.assertRaises(ValidationError):
         db_name_validator('logstash*')
示例#8
0
 def test_ends_with_dollar_sign(self):
     """
     Test case for a name that ends with '$'.
     """
     with self.assertRaises(ValidationError):
         db_name_validator('id$')
示例#9
0
 def test_starts_with_dollar_sign(self):
     """
     Test case for a name that starts with '$'.
     """
     with self.assertRaises(ValidationError):
         db_name_validator('$id')