Exemplo n.º 1
0
    def test_get_target_unitialised_target_should_raise(self):
        """
        Test getTarget(self)
        """
        sfp = SpiderFootPlugin()

        with self.assertRaises(TypeError):
            sfp.getTarget()
Exemplo n.º 2
0
    def test_get_target(self):
        """
        Test getTarget(self)
        """
        sfp = SpiderFootPlugin()

        sfp.getTarget()
        self.assertEqual('TBD', 'TBD')
Exemplo n.º 3
0
    def test_get_target_should_return_a_string(self):
        """
        Test getTarget(self)
        """
        sfp = SpiderFootPlugin()

        sfp.getTarget()
        self.assertEqual('TBD', 'TBD')
Exemplo n.º 4
0
    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)
Exemplo n.º 6
0
    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)
Exemplo n.º 7
0
    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)