Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Image for a Python 3 development environment
FROM quay.io/rofrano/nyu-devops-base:su26
FROM rofrano/nyu-devops-base:fa26

ARG USERNAME=vscode

Expand Down
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Docker-in-docker setup for lab environment
// cspell:disable
{
"name": "Docker-in-Docker",
"build": {
Expand All @@ -24,7 +25,9 @@
"pytest",
"pipenv",
"Redis",
"testdb"
"testdb",
"creds",
"flushall"
],
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# cspell:disable
#
# Makefile to build and push docker images
#
# This Makefile assumes that the current folder has a secret file called .env which contains:
# export API_KEY=...
#

# These can be overidden with env vars.
IMAGE_NAME ?= lab-docker

Expand Down Expand Up @@ -45,7 +45,7 @@ lint: ## Run the linter
.PHONY: test
test: ## Run the unit tests
$(info Running tests...)
export RETRY_COUNT=1; pytest --pspec --cov=service --cov-fail-under=95
export RETRY_COUNT=1; pytest --spec --cov=service --cov-fail-under=95

##@ Runtime

Expand Down
21 changes: 12 additions & 9 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# cspell:disable
# Python dependencies

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
Expand All @@ -8,21 +11,21 @@ flask = "==3.1.3"
redis = "==7.1.0"
flask-redis = "==0.4.0"
retry2 = "==0.9.5"
python-dotenv = "~=1.2.2"
gunicorn = "~=25.0.0"
python-dotenv = "~=1.2.4"
gunicorn = "~=26.2.0"

[dev-packages]
# Code Quality
pylint = "~=4.0.4"
flake8 = "~=7.3.0"
black = "~=26.3.1"
pylint = "~=4.1.3"
flake8 = "~=7.4.1"
black = "~=26.10.1"

# Test-Driven Development
pytest = "~=9.0.3"
pytest-pspec = "~=0.0.4"
pytest-cov = "~=7.0.0"
pytest = "~=9.1.1"
pytest-spec = "~=6.1.0"
pytest-cov = "~=7.1.0"
factory-boy = "~=3.3.3"
coverage = "~=7.13.2"
coverage = "~=7.17.0"

# Utility
honcho = "~=2.0.0"
Expand Down
1,160 changes: 612 additions & 548 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Run the tests using `pytest`
$ make test
```

PyTest is configured via the included `pyproject.toml` file to automatically include the flags `--pspec --cov=service --cov-fail-under=95` so that red-green-refactor is meaningful. If you are in a command shell that supports colors, passing tests will be green while failing tests will be red.
PyTest is configured via the included `pyproject.toml` file to automatically include the flags `--spec --cov=service --cov-fail-under=95` so that red-green-refactor is meaningful. If you are in a command shell that supports colors, passing tests will be green while failing tests will be red.

## What's featured in the project?

Expand All @@ -99,7 +99,7 @@ The development environment uses **Docker-in-Docker** so that you have an isolat

## License

Copyright (c) 2016, 2025 [John Rofrano](https://www.linkedin.com/in/JohnRofrano/). All rights reserved.
Copyright (c) 2016, 2026 [John Rofrano](https://www.linkedin.com/in/JohnRofrano/). All rights reserved.

Licensed under the Apache License. See [LICENSE](LICENSE)

Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# Setup Pytest configuration
[tool:pytest]
minversion = 6.0
addopts = --pspec --cov=service --cov-fail-under=95
addopts = --spec --cov=service --cov-fail-under=95
spec_test_format = {result} {docstring_summary}
testpaths =
tests
integration
Expand Down
3 changes: 2 additions & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
nosetests -v --with-spec --spec-color
coverage report -m
"""

import os
import logging
from unittest import TestCase
Expand All @@ -36,7 +37,7 @@
######################################################################
# T E S T C A S E S
######################################################################
class CounterTests(TestCase):
class CounterModelTest(TestCase):
"""Counter Model Tests"""

@classmethod
Expand Down
5 changes: 3 additions & 2 deletions tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
nosetests -v --with-spec --spec-color
coverage report -m
"""

import os
import logging
from unittest import TestCase
Expand All @@ -36,7 +37,7 @@
######################################################################
# T E S T C A S E S
######################################################################
class ServiceTest(TestCase):
class CounterServiceTest(TestCase):
"""REST API Server Tests"""

@classmethod
Expand Down Expand Up @@ -138,7 +139,7 @@ def test_delete_counter(self):
self.assertEqual(resp.status_code, status.HTTP_204_NO_CONTENT)

def test_method_not_allowed(self):
"""It should not allow usuported Methods"""
"""It should not allow unsupported Methods"""
resp = self.app.post("/counters")
self.assertEqual(resp.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)

Expand Down
Loading