From a45bdced8968f14a0f70c3adb15030d4682c0b04 Mon Sep 17 00:00:00 2001 From: Hong-Phuc Bui <hong-phuc.bui@htwsaar.de> Date: Mon, 06 Jul 2026 09:41:04 +0200 Subject: [PATCH] unittest mit snapshot --- 06-bezier-kurve/requirements.txt | 56 ++++++++++++++++++++++++++++ 06-bezier-kurve/__snapshots__/bezier_test.ambr | 49 ++++++++++++++++++++++++ 06-bezier-kurve/bezier_test.py | 7 +++ 3 files changed, 112 insertions(+), 0 deletions(-) diff --git a/06-bezier-kurve/__snapshots__/bezier_test.ambr b/06-bezier-kurve/__snapshots__/bezier_test.ambr new file mode 100644 index 0000000..535858e --- /dev/null +++ b/06-bezier-kurve/__snapshots__/bezier_test.ambr @@ -0,0 +1,49 @@ +# serializer version: 1 +# name: test_make_cubic_bezier + list([ + tuple( + 0, + 0, + ), + tuple( + 0.32800000000000007, + 0.21600000000000005, + ), + tuple( + 0.7040000000000002, + 0.2880000000000001, + ), + tuple( + 1.1159999999999997, + 0.2519999999999999, + ), + tuple( + 1.5520000000000003, + 0.14400000000000002, + ), + tuple( + 2.0, + 0.0, + ), + tuple( + 2.448, + -0.14400000000000002, + ), + tuple( + 2.8839999999999995, + -0.252, + ), + tuple( + 3.2960000000000003, + -0.28800000000000003, + ), + tuple( + 3.6720000000000006, + -0.21599999999999997, + ), + tuple( + 4, + 0, + ), + ]) +# --- diff --git a/06-bezier-kurve/bezier_test.py b/06-bezier-kurve/bezier_test.py new file mode 100644 index 0000000..c70bbd8 --- /dev/null +++ b/06-bezier-kurve/bezier_test.py @@ -0,0 +1,7 @@ +from bezier import make_cubic_bezier + +def test_make_cubic_bezier(snapshot): + control_points = [(0, 0), (1,1) , (3,-1) , (4, 0)] + bezier_kurve = make_cubic_bezier(control_points) + assert bezier_kurve == snapshot + \ No newline at end of file diff --git a/06-bezier-kurve/requirements.txt b/06-bezier-kurve/requirements.txt index e57426a..fcd21a3 100644 --- a/06-bezier-kurve/requirements.txt +++ b/06-bezier-kurve/requirements.txt @@ -1 +1,57 @@ +aiofiles==25.1.0 +aiohappyeyeballs==2.7.1 +aiohttp==3.14.1 +aiosignal==1.4.0 +annotated-doc==0.0.4 +annotated-types==0.7.0 +anyio==4.14.1 +attrs==26.1.0 +bidict==0.23.1 +certifi==2026.6.17 +charset-normalizer==3.4.7 +click==8.4.2 +docutils==0.23 +fastapi==0.139.0 +frozenlist==1.8.0 +h11==0.16.0 +httpcore==1.0.9 +httptools==0.8.0 +httpx==0.28.1 +idna==3.18 +ifaddr==0.2.0 +iniconfig==2.3.0 +itsdangerous==2.2.0 +Jinja2==3.1.6 +markdown2==2.5.5 +MarkupSafe==3.0.3 +multidict==6.7.1 nicegui==2.18.0 +orjson==3.11.9 +packaging==26.2 +pluggy==1.6.0 +propcache==0.5.2 +pscript==0.7.7 +pydantic==2.13.4 +pydantic_core==2.46.4 +Pygments==2.20.0 +pytest==9.1.1 +python-dotenv==1.2.2 +python-engineio==4.13.3 +python-multipart==0.0.32 +python-socketio==5.16.3 +PyYAML==6.0.3 +requests==2.34.2 +simple-websocket==1.1.0 +starlette==1.3.1 +syrupy==5.4.0 +typing-inspection==0.4.2 +typing_extensions==4.16.0 +urllib3==2.7.0 +uvicorn==0.50.0 +uvloop==0.22.1 +vbuild==0.8.2 +wait_for2==0.4.1 +watchfiles==1.2.0 +websockets==16.0 +wsproto==1.3.2 +yarl==1.24.2 -- Gitblit v1.10.0