Compare commits

..
Author SHA1 Message Date
nkogut c0cdd9159b Exercise staging health-check port mismatch
myfileagent-python-ci/pipeline/head This commit looks good
2026-11-07 23:16:10 +00:00
glovely ee128d18bd Merge pull request 'Release v2 pricing at $12 per unit' (#20) from assignment8/v2-release into main
myfileagent-python-ci/pipeline/head This commit looks good
Team manual PDF / manual (push) Successful in 3m5s
Reviewed-on: #20
Reviewed-by: glovely <glovely@stevens.edu>
2026-11-07 22:53:47 +00:00
nkogut 4d7e4f932f Set release intent to v2
myfileagent-python-ci/pipeline/head This commit looks good
myfileagent-python-ci/pipeline/pr-main This commit looks good
2026-11-07 22:49:35 +00:00
nkogut 699d509024 Update tests for v2 pricing
myfileagent-python-ci/pipeline/head Build queued...
2026-11-07 22:49:16 +00:00
nkogut 126dbb00b3 Prepare v2 pricing source
myfileagent-python-ci/pipeline/head This commit looks good
2026-11-07 22:48:53 +00:00
4 changed files with 9 additions and 6 deletions
@@ -1,6 +1,9 @@
services:
app:
image: "{{ release_image }}"
{% if target_env == 'staging' %}
command: ["gunicorn", "--bind", "0.0.0.0:8001", "app:app"]
{% endif %}
restart: unless-stopped
read_only: true
tmpfs:
+1 -1
View File
@@ -1 +1 @@
{"version": "v1", "quantity3_total": 30}
{"version": "v2", "quantity3_total": 36}
+2 -2
View File
@@ -2,8 +2,8 @@ import os
from flask import Flask, jsonify, request
app = Flask(__name__)
VERSION = "v1"
UNIT_PRICE = 10
VERSION = "v2"
UNIT_PRICE = 12
COMMIT = os.environ.get("APP_COMMIT", "development")
+3 -3
View File
@@ -7,17 +7,17 @@ class PricingTests(unittest.TestCase):
self.client = app.test_client()
def test_price(self):
self.assertEqual(total_price(3), 30)
self.assertEqual(total_price(3), 36)
response = self.client.get("/price?quantity=3")
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json["total"], 30)
self.assertEqual(response.json["total"], 36)
def test_invalid_quantity(self):
for value in ["0", "-1", "1001", "abc", "1.5"]:
self.assertEqual(self.client.get("/price?quantity=" + value).status_code, 400)
def test_release_identity(self):
self.assertEqual(self.client.get("/").json["version"], "v1")
self.assertEqual(self.client.get("/").json["version"], "v2")
self.assertEqual(self.client.get("/health").json["status"], "ok")