def test_meliae_dump_error(self): """Check the error case.""" from meliae import scanner dump_all_objects = self.mocker.replace(scanner.dump_all_objects) dump_all_objects(ANY) self.mocker.throw(ValueError) self.mocker.replay() self.assertIn("Error while trying to dump memory", meliae_dump())
def test_meliae_dump(self): """Check that the dump works.""" from meliae import scanner collect = self.mocker.replace(gc.collect) dump_all_objects = self.mocker.replace(scanner.dump_all_objects) collect() dump_all_objects(ANY) self.mocker.replay() self.assertIn("Output written to:", meliae_dump())
def render_GET(self, request): """Handle GET.""" return dump.meliae_dump()