def test_get_target_unitialised_target_should_raise(self): """ Test getTarget(self) """ sfp = SpiderFootPlugin() with self.assertRaises(TypeError): sfp.getTarget()
def test_get_target(self): """ Test getTarget(self) """ sfp = SpiderFootPlugin() sfp.getTarget() self.assertEqual('TBD', 'TBD')
def test_get_target_should_return_a_string(self): """ Test getTarget(self) """ sfp = SpiderFootPlugin() sfp.getTarget() self.assertEqual('TBD', 'TBD')
def test_get_target_invalid_target_should_exit(self): """ Test getTarget(self) """ sfp = SpiderFootPlugin() with self.assertRaises(SystemExit) as cm: sfp.getTarget() self.assertEqual(cm.exception.code, -1)
def test_set_target_should_set_a_target(self): """ Test setTarget(self, target) """ sfp = SpiderFootPlugin() target = SpiderFootTarget("spiderfoot.net", "INTERNET_NAME") sfp.setTarget(target) get_target = sfp.getTarget().targetValue self.assertIsInstance(get_target, str) self.assertEqual("spiderfoot.net", get_target)
def test_get_target_should_return_a_string(self): """ Test getTarget(self) """ sfp = SpiderFootPlugin() target = 'spiderfoot.net' sfp.setTarget(target) get_target = sfp.getTarget() self.assertEqual(str, type(get_target)) self.assertEqual(target, get_target)
def test_set_target_should_set_a_target(self): """ Test setTarget(self, target) """ sfp = SpiderFootPlugin() target = 'spiderfoot.net' sfp.setTarget(target) get_target = sfp.getTarget() self.assertIsInstance(get_target, str) self.assertEqual(target, get_target)