Implement state.generate_testcase (#438)
* ran * Some dirty work * Rm unnecessary sanitization * Fix state.generate_inputs event publishing We don't need to manually pass `self` because State is automatically forwarded as an argument. Also correctly specify a message for the state and expose to the API * Rename * Update test for new save_testcase args, make test more robust * Simplify arguments related to generate_testcase_callback by removing default arg. Add test for this behavior * Minor test fixup * Add official API docs * Remove unnecessary new event type
This commit is contained in:
@@ -86,8 +86,18 @@ class StateTest(unittest.TestCase):
|
||||
|
||||
def test_output(self):
|
||||
out = ManticoreOutput('mem:')
|
||||
out.save_testcase(self.state, 'saving state')
|
||||
keys = [x[14:] for x in out._store._data.keys()]
|
||||
name = 'mytest'
|
||||
message = 'custom message'
|
||||
out.save_testcase(self.state, name, message)
|
||||
workspace = out._store._data
|
||||
|
||||
# Make sure names are constructed correctly
|
||||
for name, data in workspace.items():
|
||||
self.assertTrue(name.startswith(name))
|
||||
if 'messages' in name:
|
||||
self.assertTrue(message in data)
|
||||
|
||||
keys = [x.split('.')[1] for x in workspace.keys()]
|
||||
|
||||
# Make sure we log everything we should be logging
|
||||
self.assertIn('smt', keys)
|
||||
|
||||
Reference in New Issue
Block a user