File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,16 @@ def write(self, message):
45
45
46
46
47
47
class FakeLogger :
48
+ """An output capturing logger suitable for being passed to the
49
+ majority of MiG code by presenting an API compatible interface
50
+ with the common logger module.
51
+
52
+ An instance of this class is made avaiable to test cases which
53
+ can pass it down into function calls and subsequenently make
54
+ assertions against any output strings hat were recorded during
55
+ execution while also avoiding noise hitting the console.
56
+ """
57
+
48
58
RE_UNCLOSEDFILE = re .compile (
49
59
'unclosed file <.*? name=\' (?P<location>.*?)\' ( .*?)?>' )
50
60
@@ -107,6 +117,15 @@ def identify_unclosed_file(specifics):
107
117
108
118
109
119
class MigTestCase (TestCase ):
120
+ """Embellished base class for MiG test cases. Provides additional commonly
121
+ used assertions as well as some basics for the standardised and idiomatic
122
+ testing of logic within the codebase.
123
+
124
+ By containing these details in a single place we can ensure the reliable
125
+ cleanup of state across tests as well as permit enforcement of constraints
126
+ on all code under test.
127
+ """
128
+
110
129
def __init__ (self , * args ):
111
130
super (MigTestCase , self ).__init__ (* args )
112
131
self ._cleanup_paths = set ()
You can’t perform that action at this time.
0 commit comments