Skip to content

Commit

Permalink
fix: python petserver parameter type
Browse files Browse the repository at this point in the history
  • Loading branch information
stevana committed Dec 23, 2024
1 parent 06e8609 commit e070223
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions example/petstore-python-flask/petstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
# NOTE: Not thread-safe and won't work if clients connect concurrently.
petstore = {}

@app.route("/pet/<pet_id>", methods=["GET"])
@app.route("/pet/<int:pet_id>", methods=["GET"])
def get_pet(pet_id):
if pet_id in petstore:
pet_name = petstore[pet_id]
return jsonify(petId=pet_id, petName=pet_name)
else:
return "Pet not found", 404
return jsonify(error="Pet not found"), 404

@app.route("/pet", methods=["POST"])
def add_pet():
Expand Down
5 changes: 2 additions & 3 deletions src/Spex/Experiment/LinearTemporalLogic.hs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
module Spex.Experiment.LinearTemporalLogic
(module Spex.Experiment.LinearTemporalLogic)
where
module Spex.Experiment.LinearTemporalLogic (module Spex.Experiment.LinearTemporalLogic) where

-- Bug Catching: Automated Program Verification:
-- https://www.cs.cmu.edu/~15414/
-- https://www.cs.cmu.edu/~15414/s23/lectures/24-ltl.pdf
-- NuSMV: https://www.cs.cmu.edu/~15414/lectures/21-ltl.pdf
-- The algorithm used in the 2018 lectures:
-- https://link.springer.com/content/pdf/10.1007/978-0-387-34892-6_1.pdf
-- https://en.wikipedia.org/wiki/Property_Specification_Language

import Data.Maybe

Expand Down
11 changes: 7 additions & 4 deletions src/Spex/Experiment/Protocol3.hs
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,14 @@ test seed = do
mapM_ (putStrLn . prettyEnvelope) (runSim sim)
return False

t :: Int -> IO ()
t 0 = putStrLn "Success!"
t numberOfTests = do
t' :: Int -> IO ()
t' 0 = putStrLn "Success!"
t' numberOfTests = do
seed <- randomIO
passed <- test seed
if passed
then t (numberOfTests - 1)
then t' (numberOfTests - 1)
else return ()

t :: IO ()
t = t' 100

0 comments on commit e070223

Please sign in to comment.