-
Notifications
You must be signed in to change notification settings - Fork 2
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
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Futuramaapi | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.12" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ruff pytest | ||
pip install -r requirements.txt | ||
- name: Ruff | ||
run: | | ||
ruff --output-format=github . | ||
- name: Pytest | ||
run: | | ||
python -m pytest -p tests.plugins.env_vars |
Empty file.
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,18 @@ | ||
from app.repositories.models import to_camel | ||
|
||
|
||
class TestModelUtils: | ||
def test_to_camel_should_return_snake_case_when_lower_case_text_has_one_underline( | ||
self | ||
): | ||
assert to_camel("snake_case") == "snakeCase" | ||
|
||
def test_to_camel_should_return_snake_case_when_lower_case_text_has_two_underlines( | ||
self | ||
): | ||
assert to_camel("snake_case_snake") == "snakeCaseSnake" | ||
|
||
def test_to_camel_should_return_snake_case_when_upper_case_text_has_one_underline( | ||
self | ||
): | ||
assert to_camel("SNAKE_CASE") == "snakeCase" |
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,4 @@ | ||
[tool.pytest.ini_options] | ||
pythonpath = [ | ||
"." | ||
] |
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
Empty file.
Empty file.
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,16 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
|
||
@pytest.hookimpl(tryfirst=True) | ||
def pytest_load_initial_conftests(args, early_config, parser): | ||
with open(".env.template") as file: | ||
data = file.read() | ||
|
||
for line in data.split(): | ||
if line.startswith("#"): | ||
continue | ||
|
||
key, value = line.split()[0].split("=", 1) | ||
os.environ[key] = value |