Skip to content

Commit 2e32e83

Browse files
committed
Enumerate test classes and incident types (as in #132).
1 parent e8e54ec commit 2e32e83

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

validator/src/validator/incident.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
import sys
22
import os
3+
from enum import Enum
4+
5+
6+
7+
class TestClass(Enum):
8+
INTERNAL = 0
9+
UNICODE = 1
10+
FORMAT = 2
11+
MORPHO = 3
12+
SYNTAX = 4
13+
ENHANCED = 5
14+
COREF = 6
15+
METADATA = 7
16+
17+
def __str__(self):
18+
return self.name
19+
20+
21+
22+
class IncidentType(Enum):
23+
ERROR = 1
24+
WARNING = 0
325

426

527

@@ -11,7 +33,7 @@ class Incident:
1133
# We can modify the class-level defaults before a batch of similar tests.
1234
# Then we do not have to repeat the shared parameters for each test.
1335
default_level = 1
14-
default_testclass = 'Format'
36+
default_testclass = TestClass.FORMAT
1537
default_testid = 'generic-error'
1638
default_message = 'No error description provided.'
1739
default_lineno = None

0 commit comments

Comments
 (0)