コード例 #1
0
ファイル: model_controller.py プロジェクト: BwRy/faraday
    def testEditVulnSyncGetsMapperDispatchedASYNC(self):
        vuln = ModelObjectVuln("coquito")

        params = ('new_name', 'new_desc', 'high', "ref1")

        self.genericEdit(vuln, params, controller.ModelController.editVulnASYNC, process_pending=True)

        self.assertEquals(vuln.getName(), 'new_name', "Name not updated")
        self.assertEquals(vuln.getDescription(), 'new_desc', "Description not updated")
        self.assertEquals(vuln.getSeverity(), 'high', "Severity not updated")
コード例 #2
0
    def testEditVulnSyncGetsMapperDispatchedSYNC(self):
        vuln = ModelObjectVuln("coquito")

        params = ('new_name', 'new_desc', 'high', "ref1")

        self.genericEdit(vuln, params, controller.ModelController.editVulnSYNC)

        self.assertEquals(vuln.getName(), 'new_name', "Name not updated")
        self.assertEquals(vuln.getDescription(), 'new_desc',
                          "Description not updated")
        self.assertEquals(vuln.getSeverity(), 'high', "Severity not updated")
コード例 #3
0
ファイル: vulns.py プロジェクト: BecomingMore/faraday
    def testChangeVulnDescriptionUsingUpdateAttributesMethod(self):
        """
        Until we have a single attribute to store the vuln's descrption
        we need to make sure we're always accessing the valid one (_desc)
        """
        vuln = ModelObjectVuln(
            name='VulnTest', desc='TestDescription', severity='info')

        self.assertEquals(vuln._desc, 'TestDescription',
            'Vulnerability desc should be the given during creation')

        vuln.updateAttributes(desc="new description")

        self.assertEquals(vuln.getDescription(), 'new description',
            'Vulnerability desc wasn\'t updated correctly')

        self.assertEquals(vuln._desc, 'new description',
            'Vulnerability desc wasn\'t updated correctly')
コード例 #4
0
ファイル: vulns.py プロジェクト: bopopescu/faraday-1
    def testChangeVulnDescriptionUsingUpdateAttributesMethod(self):
        """
        Until we have a single attribute to store the vuln's descrption
        we need to make sure we're always accessing the valid one (_desc)
        """
        vuln = ModelObjectVuln(name='VulnTest',
                               desc='TestDescription',
                               severity='info')

        self.assertEquals(
            vuln._desc, 'TestDescription',
            'Vulnerability desc should be the given during creation')

        vuln.updateAttributes(desc="new description")

        self.assertEquals(vuln.getDescription(), 'new description',
                          'Vulnerability desc wasn\'t updated correctly')

        self.assertEquals(vuln._desc, 'new description',
                          'Vulnerability desc wasn\'t updated correctly')