コード例 #1
0
ファイル: workspaces.py プロジェクト: youdinforsec/faraday
 def _get_base_query(self, object_id=None):
     confirmed = self._get_querystring_boolean_field('confirmed')
     active = self._get_querystring_boolean_field('active')
     readonly = self._get_querystring_boolean_field('readonly')
     query = Workspace.query_with_count(confirmed,
                                        active=active,
                                        readonly=readonly,
                                        workspace_name=object_id)
     return query
コード例 #2
0
def test_vuln_count(workspace, second_workspace, database):
    if database.engine.dialect.name == 'sqlite':
        return
    populate_workspace(workspace)
    populate_workspace(second_workspace)
    workspace = Workspace.query_with_count(
        None, workspace_name=workspace.name).fetchone()
    assert workspace['vulnerability_web_count'] == WEB_VULN_COUNT
    assert workspace['vulnerability_code_count'] == SOURCE_CODE_VULN_COUNT
    assert workspace['vulnerability_standard_count'] == sum(
        STANDARD_VULN_COUNT)
    assert workspace['vulnerability_total_count'] == (
        sum(STANDARD_VULN_COUNT) + WEB_VULN_COUNT + SOURCE_CODE_VULN_COUNT)