-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
26 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG PY_IMAGE=3.11-slim-bookworm | ||
ARG PY_IMAGE=3.12-slim-bookworm | ||
FROM python:$PY_IMAGE as base | ||
|
||
# Metadata | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
"""Unit test for security.cors.py""" | ||
|
||
from foca.security.cors import enable_cors | ||
from flask import Flask | ||
from unittest.mock import patch | ||
|
||
from flask import Flask | ||
|
||
from unittest.mock import patch | ||
from foca.security.cors import enable_cors | ||
|
||
|
||
@patch('flask_cors.CORS') | ||
def test_enable_cors(test_patch): | ||
"""Test that CORS is called with app as a parameter | ||
""" | ||
def test_enable_cors(): | ||
"""Test that CORS is called with app as a parameter.""" | ||
app = Flask(__name__) | ||
assert enable_cors(app) is None | ||
assert test_patch.called_with(app) | ||
with patch('foca.security.cors.CORS') as mock_cors: | ||
enable_cors(app) | ||
mock_cors.assert_called_once_with(app) |