

def test_number_of_new_false_positives(self):
    response = {
        'scenario_id': '1',
        'req_headers': 'headers',
        'req_body': 'body',
        'url': 'url',
        'req_method': 'method',
        'timestamp': datetime.datetime.utcnow(),
        'server_protocol_error': None,
        'server_timeout': False,
        'server_error_text_detected': False,
        'server_error_text_matched': 'matched_text',
        'resp_statuscode': 'statuscode',
        'resp_headers': 'resp_headers',
        'resp_body': 'resp_body',
        'resp_history': 'resp_history',
    }
    dbtools.add_false_positive(self.context, response)
    self.assertEqual(dbtools.number_of_new_in_database(self.context), 1, 'After adding one, no one finding in database')
    dbtools.add_false_positive(self.context, response)
    self.assertEqual(dbtools.number_of_new_in_database(self.context), 2, 'After adding two, no two findings in db')

dataset/ETHPy150Open F-Secure/mittn/mittn/httpfuzzer/test_dbtools.py dbtools_test_case.test_number_of_new_false_positives/original