Skip to content

Commit

Permalink
feat(github-actions): removed votepeloclima tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomario committed Feb 3, 2025
1 parent d466095 commit be46e19
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 39 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/pubish_org_eleicoes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools
pip install -r app/requirements.txt
pip install -r app/org_eleicoes/requirements.txt
pip install pytest pytest-django
- name: Run tests
run: |
pytest --ds=org_eleicoes.votepeloclima.settings app/org_eleicoes/votepeloclima/candidature/tests/
pytest --ds=org_eleicoes.votepeloclima.settings app/contrib/ds/tests/
pytest --ds=org_eleicoes.votepeloclima.settings app/contrib/ds/blocks/tests/
pytest --ds=org_eleicoes.votepeloclima.settings app/contrib/ds/card/tests/
pytest --ds=org_eleicoes.votepeloclima.settings app/contrib/ds/accordion/tests/
pytest --ds=org_eleicoes.votepeloclima.settings app/contrib/ds/carousel/tests/
pytest --ds=org_eleicoes.votepeloclima.settings app/contrib/ds/counter/tests/
pytest --ds=org_eleicoes.votepeloclima.settings app/contrib/ds/grid/tests/
pytest --ds=org_eleicoes.votepeloclima.settings app/contrib/ds/link/tests/
pytest --ds=org_eleicoes.votepeloclima.settings app/contrib/ds/picture/tests/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand Down
5 changes: 0 additions & 5 deletions app/contrib/ds/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def create_image(mode="RGB", size=(800, 600)):

return image


def get_image(image_name="test_file.jpg", size=(800, 600)):
"""
Creates and stores an image to the file system using PILImage
Expand All @@ -44,7 +43,6 @@ def get_image(image_name="test_file.jpg", size=(800, 600)):
"path": image_path,
}


def get_file(file_name="test_file.pdf"):
"""
Creates and stores an arbitrary file into a temporary dir
Expand All @@ -64,7 +62,6 @@ def get_file(file_name="test_file.pdf"):
"path": file_path,
}


def get_filer_image(image_name="test_file.jpg", size=(800, 600)):
"""
Creates and stores an image to filer and returns it
Expand All @@ -84,7 +81,6 @@ def get_filer_image(image_name="test_file.jpg", size=(800, 600)):

return filer_object


def get_filer_file(file_name="test_file.pdf", folder=None):
"""
Creates and stores a file to filer and returns it
Expand All @@ -106,7 +102,6 @@ def get_filer_file(file_name="test_file.pdf", folder=None):

return filer_object


def get_filer_folder(folder_name="test_folder", parent=None):
"""
Creates and returns a filer folder
Expand Down
9 changes: 2 additions & 7 deletions app/org_eleicoes/votepeloclima/candidature/locations_utils.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
from typing import List, Tuple
from django.core.exceptions import ImproperlyConfigured
from contrib.bonde.models import PlacesIBGE


def get_states(column_label="nome_uf") -> List[Tuple[str, str]]:
try:
states = PlacesIBGE.objects.values('uf', column_label).distinct()
return sorted([(state['uf'], state[column_label]) for state in states], key=lambda x: x[1])
except ImproperlyConfigured:
return []
states = PlacesIBGE.objects.values('uf', column_label).distinct()
return sorted([(state['uf'], state[column_label]) for state in states], key=lambda x: x[1])

def get_ufs() -> List[Tuple[str, str]]:
return get_states(column_label="sigla_uf")
Expand Down

0 comments on commit be46e19

Please sign in to comment.