def test_scandelete(self): """ Test scandelete(self, id, confirm=None) """ opts = self.default_options opts['__modules__'] = dict() sfwebui = SpiderFootWebUi(self.web_default_options, opts) scan_delete = sfwebui.scandelete("example scan id", None) self.assertIsInstance(scan_delete, str) scan_delete = sfwebui.scandelete("example scan id", 1) self.assertIsInstance(scan_delete, str)
def test_scandelete_invalid_scanid_should_return_an_error(self): """ Test scandelete(self, id) """ opts = self.default_options opts['__modules__'] = dict() sfwebui = SpiderFootWebUi(self.web_default_options, opts) scan_delete = sfwebui.scandelete("example scan id") self.assertIsInstance(scan_delete, dict) self.assertEqual("Scan example scan id does not exist", scan_delete.get('error').get('message'))