-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from cloudsteak/Action
Kód1 Action
- Loading branch information
Showing
14 changed files
with
211 additions
and
22 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
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,14 +1,20 @@ | ||
# Python 3.11 | ||
FROM python:3.11-slim-buster | ||
|
||
# Kiinduló munkakönyvtár beállítása | ||
WORKDIR /app | ||
|
||
COPY requirements.txt ./ | ||
RUN pip install -r requirements.txt | ||
|
||
# Fájlok másolása | ||
COPY . . | ||
|
||
# Függőségek telepítése | ||
RUN pip install -r requirements.txt | ||
|
||
# Port definiálása | ||
EXPOSE 8000 | ||
|
||
# Flask alkalmazás beállítása | ||
ENV FLASK_APP=app.py | ||
|
||
# Flask alkalmazás indítása | ||
CMD ["flask", "run", "--host", "0.0.0.0", "--port", "8000"] |
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 +1,7 @@ | ||
Flask==3.0.2 | ||
blinker==1.8.1 | ||
click==8.1.7 | ||
Flask==3.0.3 | ||
itsdangerous==2.2.0 | ||
Jinja2==3.1.3 | ||
MarkupSafe==2.1.5 | ||
Werkzeug==3.0.2 |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import unittest | ||
from app import app # Make sure this import matches the location and name of your Flask application module | ||
|
||
class TestFlaskApp(unittest.TestCase): | ||
def setUp(self): | ||
# Configure the app for testing | ||
app.config['TESTING'] = True | ||
# Create a test client | ||
self.client = app.test_client() | ||
|
||
def test_info_endpoint(self): | ||
# Send a GET request to the '/' endpoint | ||
response = self.client.get('/') | ||
# Check that the response is OK | ||
self.assertEqual(response.status_code, 200) | ||
# Check the data returned | ||
self.assertEqual(response.data.decode('utf-8'), "Docker alkalmazás") | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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 +1,7 @@ | ||
Flask==3.0.2 | ||
blinker==1.8.1 | ||
click==8.1.7 | ||
Flask==3.0.3 | ||
itsdangerous==2.2.0 | ||
Jinja2==3.1.3 | ||
MarkupSafe==2.1.5 | ||
Werkzeug==3.0.2 |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import unittest | ||
from app import app # Make sure this import matches the location and name of your Flask application module | ||
|
||
class TestFlaskApp(unittest.TestCase): | ||
def setUp(self): | ||
# Configure the app for testing | ||
app.config['TESTING'] = True | ||
# Create a test client | ||
self.client = app.test_client() | ||
|
||
def test_info_endpoint(self): | ||
# Send a GET request to the '/' endpoint | ||
response = self.client.get('/') | ||
# Check that the response is OK | ||
self.assertEqual(response.status_code, 200) | ||
# Check the data returned | ||
self.assertEqual(response.data.decode('utf-8'), "Docker alkalmazás") | ||
|
||
def test_hello_endpoint(self): | ||
# Send a GET request to the '/' endpoint | ||
response = self.client.get('/hello') | ||
# Check that the response is OK | ||
self.assertEqual(response.status_code, 200) | ||
# Check the data returned | ||
self.assertEqual(response.data.decode('utf-8'), "Helló Világ!") | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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 +1,7 @@ | ||
Flask==3.0.2 | ||
blinker==1.8.1 | ||
click==8.1.7 | ||
Flask==3.0.3 | ||
itsdangerous==2.2.0 | ||
Jinja2==3.1.3 | ||
MarkupSafe==2.1.5 | ||
Werkzeug==3.0.2 |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import unittest | ||
from app import app # Make sure this import matches the location and name of your Flask application module | ||
|
||
class TestFlaskApp(unittest.TestCase): | ||
def setUp(self): | ||
# Configure the app for testing | ||
app.config['TESTING'] = True | ||
# Create a test client | ||
self.client = app.test_client() | ||
|
||
def test_info_endpoint(self): | ||
# Send a GET request to the '/' endpoint | ||
response = self.client.get('/') | ||
# Check that the response is OK | ||
self.assertEqual(response.status_code, 200) | ||
# Check the data returned | ||
self.assertEqual(response.data.decode('utf-8'), "Docker alkalmazás") | ||
|
||
def test_hello_endpoint(self): | ||
# Send a GET request to the '/hello' endpoint | ||
response = self.client.get('/hello') | ||
# Check that the response is OK | ||
self.assertEqual(response.status_code, 200) | ||
# Check the data returned | ||
self.assertEqual(response.data.decode('utf-8'), "Helló Világ!") | ||
|
||
def test_name_endpoint(self): | ||
# Send a GET request to the '/name' endpoint | ||
response = self.client.get('/name?name=teszt') | ||
# Check that the response is OK | ||
self.assertEqual(response.status_code, 200) | ||
# Check the data returned | ||
self.assertEqual(response.data.decode('utf-8'), "Helló teszt!") | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |