FlaskTester 4.1__tar.gz → 4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: FlaskTester
3
- Version: 4.1
3
+ Version: 4.2
4
4
  Summary: Pytest fixtures for Flask internal and external authenticated tests
5
5
  Author-email: Fabien Coelho <flask.tester@coelho.net>
6
6
  License: CC0
@@ -378,7 +378,10 @@ class Client:
378
378
  data_param[name] = "null"
379
379
  elif isinstance(val, (io.IOBase, tuple)):
380
380
  pass # file parameters?
381
- elif isinstance(val, (bool, int, float, str, list, dict)):
381
+ elif isinstance(val, (bool, int, float, str)):
382
+ # FIXME bool seems KO
383
+ pass
384
+ elif isinstance(val, (list, dict)):
382
385
  data_param[name] = json.dumps(val)
383
386
  elif "model_dump_json" in val.__dir__() and callable(val.model_dump_json):
384
387
  data_param[name] = val.model_dump_json()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: FlaskTester
3
- Version: 4.1
3
+ Version: 4.2
4
4
  Summary: Pytest fixtures for Flask internal and external authenticated tests
5
5
  Author-email: Fabien Coelho <flask.tester@coelho.net>
6
6
  License: CC0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "FlaskTester"
7
- version = "4.1"
7
+ version = "4.2"
8
8
  authors = [ { name = "Fabien Coelho", email = "flask.tester@coelho.net" } ]
9
9
  description = "Pytest fixtures for Flask internal and external authenticated tests"
10
10
  readme = "README.md"
@@ -368,6 +368,18 @@ def test_classes(api):
368
368
  assert thing_eq(tclass(**json), param)
369
369
  assert n == 192
370
370
 
371
- # null translation
371
+ # simple types translation
372
372
  assert api.get("/t0", 200, json={"t": None}).json is None
373
373
  assert api.get("/t0", 200, data={"t": None}).json is None
374
+ assert api.get("/t0", 200, json={"t": True}).json == True
375
+ assert api.get("/t0", 200, json={"t": False}).json == False
376
+ # non working, bad JsonData conversion
377
+ api.get("/t0", 400, data={"t": True})
378
+ api.get("/t0", 400, data={"t": False})
379
+ assert api.get("/t0", 200, json={"t": 2345}).json == 2345
380
+ assert api.get("/t0", 200, data={"t": 5432}).json == 5432
381
+ assert api.get("/t0", 200, json={"t": 23.45}).json == 23.45
382
+ assert api.get("/t0", 200, data={"t": 54.32}).json == 54.32
383
+ assert api.get("/t0", 200, json={"t": "Susie"}).json == "Susie"
384
+ api.get("/t0", 400, data={"t": "Susie"}) # raw str is not JSON
385
+ assert api.get("/t0", 200, data={"t": "\"Susie\""}).json == "Susie"
File without changes
File without changes
File without changes
File without changes
File without changes