Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ djangorestframework==3.16.1
# -r requirements.in
# dogesec-commons
# drf-spectacular
dogesec-commons==1.4.8
dogesec-commons==1.4.9
# via -r requirements.in
drf-spectacular==0.29.0
# via
Expand Down
10 changes: 5 additions & 5 deletions tests/full/other_tests/test_update_kb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def test_update_kb_returns_job(self, client, celery_no_eager):
assert data["type"] == "sync-knowledgebase"
assert data["parameters"]["knowledgebase"] == "cwe"

# Test for attack-enterprise
resp = client.patch("/api/v1/tasks/sync-knowledgebases/attack-enterprise/")
# Test for enterprise-attack
resp = client.patch("/api/v1/tasks/sync-knowledgebases/enterprise-attack/")
assert resp.status_code == 201
data = resp.json()
assert data["type"] == "sync-knowledgebase"
assert data["parameters"]["knowledgebase"] == "attack-enterprise"
assert data["parameters"]["knowledgebase"] == "enterprise-attack"

@pytest.mark.parametrize(
"kb",
Expand Down Expand Up @@ -65,11 +65,11 @@ def test_update_kb_calls_kbsync_success(self, mock_kbsync, client):
def test_update_kb_calls_kbsync_fails(self, mock_kbsync, client):
mock_kbsync.side_effect = ValueError("Simulated KB sync failure")
with pytest.raises(ValueError):
client.patch("/api/v1/tasks/sync-knowledgebases/attack-enterprise/")
client.patch("/api/v1/tasks/sync-knowledgebases/enterprise-attack/")

mock_kbsync.assert_called_once()
args, kwargs = mock_kbsync.call_args
assert args == ("nvd_cve_vertex_collection", "attack-enterprise")
assert args == ("nvd_cve_vertex_collection", "enterprise-attack")
assert "update_time" in kwargs

job = models.Job.objects.all().last()
Expand Down
2 changes: 1 addition & 1 deletion vulmatch/server/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ class KBSyncView(viewsets.GenericViewSet):
valid_knowledge_bases = [
"capec",
"cwe",
"attack-enterprise",
"enterprise-attack",
]
openapi_path_params = [
OpenApiParameter(
Expand Down
Loading