From e7d4e70445bece10a8a3f765ec17369dac1d9acd Mon Sep 17 00:00:00 2001 From: Alan Pryor Date: Wed, 22 Jan 2020 10:42:52 -0600 Subject: [PATCH] Update tests for Marshmallow 3 Fixes #3 --- app/fizz/fizzbar/controller_test.py | 6 +++--- app/fizz/fizzbar/schema_test.py | 2 +- app/fizz/fizzbaz/controller_test.py | 6 +++--- app/fizz/fizzbaz/schema_test.py | 2 +- app/other_api/doodad/controller_test.py | 6 +++--- app/other_api/doodad/schema_test.py | 2 +- app/other_api/whatsit/controller_test.py | 6 +++--- app/other_api/whatsit/schema_test.py | 2 +- app/widget/controller_test.py | 6 +++--- app/widget/schema_test.py | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/fizz/fizzbar/controller_test.py b/app/fizz/fizzbar/controller_test.py index e6359e3..af87d4c 100644 --- a/app/fizz/fizzbar/controller_test.py +++ b/app/fizz/fizzbar/controller_test.py @@ -37,7 +37,7 @@ class TestFizzbarResource: make_fizzbar(456, name="Test Fizzbar 2"), ] ) - .data + ) for r in results: assert r in expected @@ -53,7 +53,7 @@ class TestFizzbarResource: expected = ( FizzbarSchema() .dump(Fizzbar(name=payload["name"], purpose=payload["purpose"])) - .data + ) assert result == expected @@ -94,6 +94,6 @@ class TestFizzbarIdResource: .dump( Fizzbar(fizzbar_id=123, name="New Fizzbar", purpose="New purpose") ) - .data + ) assert result == expected diff --git a/app/fizz/fizzbar/schema_test.py b/app/fizz/fizzbar/schema_test.py index 87ca094..34ec0ab 100644 --- a/app/fizz/fizzbar/schema_test.py +++ b/app/fizz/fizzbar/schema_test.py @@ -17,7 +17,7 @@ def test_FizzbarSchema_create(schema: FizzbarSchema): def test_FizzbarSchema_works(schema: FizzbarSchema): params: FizzbarInterface = schema.load( {"fizzbarId": "123", "name": "Test fizzbar", "purpose": "Test purpose"} - ).data + ) fizzbar = Fizzbar(**params) assert fizzbar.fizzbar_id == 123 diff --git a/app/fizz/fizzbaz/controller_test.py b/app/fizz/fizzbaz/controller_test.py index 7228f4b..0b4146b 100644 --- a/app/fizz/fizzbaz/controller_test.py +++ b/app/fizz/fizzbaz/controller_test.py @@ -37,7 +37,7 @@ class TestFizzbazResource: make_fizzbaz(456, name="Test Fizzbaz 2"), ] ) - .data + ) for r in results: assert r in expected @@ -53,7 +53,7 @@ class TestFizzbazResource: expected = ( FizzbazSchema() .dump(Fizzbaz(name=payload["name"], purpose=payload["purpose"])) - .data + ) assert result == expected @@ -94,6 +94,6 @@ class TestFizzbazIdResource: .dump( Fizzbaz(fizzbaz_id=123, name="New Fizzbaz", purpose="New purpose") ) - .data + ) assert result == expected diff --git a/app/fizz/fizzbaz/schema_test.py b/app/fizz/fizzbaz/schema_test.py index c9eecf5..7be838f 100644 --- a/app/fizz/fizzbaz/schema_test.py +++ b/app/fizz/fizzbaz/schema_test.py @@ -17,7 +17,7 @@ def test_FizzbazSchema_create(schema: FizzbazSchema): def test_FizzbazSchema_works(schema: FizzbazSchema): params: FizzbazInterface = schema.load( {"fizzbazId": "123", "name": "Test fizzbaz", "purpose": "Test purpose"} - ).data + ) fizzbaz = Fizzbaz(**params) assert fizzbaz.fizzbaz_id == 123 diff --git a/app/other_api/doodad/controller_test.py b/app/other_api/doodad/controller_test.py index d814a9f..8405f32 100644 --- a/app/other_api/doodad/controller_test.py +++ b/app/other_api/doodad/controller_test.py @@ -37,7 +37,7 @@ class TestDoodadResource: make_doodad(456, name="Test Doodad 2"), ] ) - .data + ) for r in results: assert r in expected @@ -53,7 +53,7 @@ class TestDoodadResource: expected = ( DoodadSchema() .dump(Doodad(name=payload["name"], purpose=payload["purpose"])) - .data + ) assert result == expected @@ -92,6 +92,6 @@ class TestDoodadIdResource: expected = ( DoodadSchema() .dump(Doodad(doodad_id=123, name="New Doodad", purpose="New purpose")) - .data + ) assert result == expected diff --git a/app/other_api/doodad/schema_test.py b/app/other_api/doodad/schema_test.py index 02137bc..11aaeb8 100644 --- a/app/other_api/doodad/schema_test.py +++ b/app/other_api/doodad/schema_test.py @@ -17,7 +17,7 @@ def test_DoodadSchema_create(schema: DoodadSchema): def test_DoodadSchema_works(schema: DoodadSchema): params: DoodadInterface = schema.load( {"doodadId": "123", "name": "Test doodad", "purpose": "Test purpose"} - ).data + ) doodad = Doodad(**params) assert doodad.doodad_id == 123 diff --git a/app/other_api/whatsit/controller_test.py b/app/other_api/whatsit/controller_test.py index c43b6ad..cc3a2c3 100644 --- a/app/other_api/whatsit/controller_test.py +++ b/app/other_api/whatsit/controller_test.py @@ -37,7 +37,7 @@ class TestWhatsitResource: make_whatsit(456, name="Test Whatsit 2"), ] ) - .data + ) for r in results: assert r in expected @@ -53,7 +53,7 @@ class TestWhatsitResource: expected = ( WhatsitSchema() .dump(Whatsit(name=payload["name"], purpose=payload["purpose"])) - .data + ) assert result == expected @@ -94,6 +94,6 @@ class TestWhatsitIdResource: .dump( Whatsit(whatsit_id=123, name="New Whatsit", purpose="New purpose") ) - .data + ) assert result == expected diff --git a/app/other_api/whatsit/schema_test.py b/app/other_api/whatsit/schema_test.py index 0e1eca9..167346a 100644 --- a/app/other_api/whatsit/schema_test.py +++ b/app/other_api/whatsit/schema_test.py @@ -17,7 +17,7 @@ def test_WhatsitSchema_create(schema: WhatsitSchema): def test_WhatsitSchema_works(schema: WhatsitSchema): params: WhatsitInterface = schema.load( {"whatsitId": "123", "name": "Test whatsit", "purpose": "Test purpose"} - ).data + ) whatsit = Whatsit(**params) assert whatsit.whatsit_id == 123 diff --git a/app/widget/controller_test.py b/app/widget/controller_test.py index cb62505..7035b45 100644 --- a/app/widget/controller_test.py +++ b/app/widget/controller_test.py @@ -35,7 +35,7 @@ class TestWidgetResource: make_widget(456, name="Test Widget 2"), ] ) - .data + ) for r in results: assert r in expected @@ -51,7 +51,7 @@ class TestWidgetResource: expected = ( WidgetSchema() .dump(Widget(name=payload["name"], purpose=payload["purpose"])) - .data + ) assert result == expected @@ -91,6 +91,6 @@ class TestWidgetIdResource: expected = ( WidgetSchema() .dump(Widget(widget_id=123, name="New Widget", purpose="New purpose")) - .data + ) assert result == expected diff --git a/app/widget/schema_test.py b/app/widget/schema_test.py index c349dca..8992aa5 100644 --- a/app/widget/schema_test.py +++ b/app/widget/schema_test.py @@ -17,7 +17,7 @@ def test_WidgetSchema_create(schema: WidgetSchema): def test_WidgetSchema_works(schema: WidgetSchema): params: WidgetInterface = schema.load( {"widgetId": "123", "name": "Test widget", "purpose": "Test purpose"} - ).data + ) widget = Widget(**params) assert widget.widget_id == 123