Skip to content

Commit f231d12

Browse files
author
renzon
committed
Instalado Servidor de Integração Contínua
close #1
1 parent 9a01e35 commit f231d12

File tree

7 files changed

+125
-2
lines changed

7 files changed

+125
-2
lines changed

.github/workflows/django.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Aplicação Django
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
env:
8+
PIPENV_NO_INHERIT: 1
9+
PIPENV_IGNORE_VIRTUALENVS: 1
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python 3.8
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.8
18+
- name: Instalar Dependências
19+
run: |
20+
pip install pipenv
21+
pipenv sync --dev
22+
- name: Rodar Testes Automáticos
23+
run: |
24+
pipenv run pytest webdev

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7+
pytest-django = "*"
78

89
[packages]
910
django = "*"

Pipfile.lock

Lines changed: 82 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[tool:pytest]
2+
DJANGO_SETTINGS_MODULE = webdev.settings
3+
# -- recommended but optional:
4+
python_files = tests.py test_*.py *_tests.py

webdev/home_view.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.http import HttpResponse
2+
3+
4+
def home(request):
5+
return HttpResponse('Olá Django Pro')

webdev/test_home.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.test import Client
2+
3+
4+
def test_home_status_code(client: Client):
5+
reposta = client.get('/')
6+
assert reposta.status_code == 200

webdev/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
from django.contrib import admin
1717
from django.urls import path
1818

19+
from webdev.home_view import home
20+
1921
urlpatterns = [
2022
path('admin/', admin.site.urls),
23+
path('', home),
2124
]

0 commit comments

Comments
 (0)