Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'app'>>
- @patch.object(
- FizzbarService,
- "get_all",
- lambda: [
- make_fizzbar(123, name="Test Fizzbar 1"),
- make_fizzbar(456, name="Test Fizzbar 2"),
- ],
- )
- def test_get(self, client: FlaskClient): # noqa
- with client:
- results = client.get(
- f"/api/{BASE_ROUTE}/fizzbar", follow_redirects=True
- ).get_json()
- expected = (
- FizzbarSchema(many=True)
- .dump(
- [
- make_fizzbar(123, name="Test Fizzbar 1"),
- > make_fizzbar(456, name="Test Fizzbar 2"),
- ]
- )
- .data
- )
- E AttributeError: 'list' object has no attribute 'data'
- app/fizz/fizzbar/controller_test.py:37: AttributeError
- ___________________________________________ TestFizzbarResource.test_post ____________________________________________
- self = <app.fizz.fizzbar.controller_test.TestFizzbarResource object at 0x7fbcc97cf550>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(
- FizzbarService, "create", lambda create_request: Fizzbar(**create_request)
- )
- def test_post(self, client: FlaskClient): # noqa
- with client:
- payload = dict(name="Test fizzbar", purpose="Test purpose")
- result = client.post(f"/api/{BASE_ROUTE}/fizzbar/", json=payload).get_json()
- expected = (
- FizzbarSchema()
- > .dump(Fizzbar(name=payload["name"], purpose=payload["purpose"]))
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/fizz/fizzbar/controller_test.py:55: AttributeError
- ___________________________________________ TestFizzbarIdResource.test_put ___________________________________________
- self = <app.fizz.fizzbar.controller_test.TestFizzbarIdResource object at 0x7fbcc977d650>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(FizzbarService, "get_by_id", lambda id: make_fizzbar(id=id))
- @patch.object(FizzbarService, "update", fake_update)
- def test_put(self, client: FlaskClient): # noqa
- with client:
- result = client.put(
- f"/api/{BASE_ROUTE}/fizzbar/123",
- json={"name": "New Fizzbar", "purpose": "New purpose"},
- ).get_json()
- expected = (
- FizzbarSchema()
- .dump(
- > Fizzbar(fizzbar_id=123, name="New Fizzbar", purpose="New purpose")
- )
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/fizz/fizzbar/controller_test.py:95: AttributeError
- ______________________________________________ test_FizzbarSchema_works ______________________________________________
- schema = <FizzbarSchema(many=False)>
- def test_FizzbarSchema_works(schema: FizzbarSchema):
- params: FizzbarInterface = schema.load(
- > {"fizzbarId": "123", "name": "Test fizzbar", "purpose": "Test purpose"}
- ).data
- E AttributeError: 'dict' object has no attribute 'data'
- app/fizz/fizzbar/schema_test.py:19: AttributeError
- ____________________________________________ TestFizzbazResource.test_get ____________________________________________
- self = <app.fizz.fizzbaz.controller_test.TestFizzbazResource object at 0x7fbcc9452a50>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(
- FizzbazService,
- "get_all",
- lambda: [
- make_fizzbaz(123, name="Test Fizzbaz 1"),
- make_fizzbaz(456, name="Test Fizzbaz 2"),
- ],
- )
- def test_get(self, client: FlaskClient): # noqa
- with client:
- results = client.get(
- f"/api/{BASE_ROUTE}/fizzbaz", follow_redirects=True
- ).get_json()
- expected = (
- FizzbazSchema(many=True)
- .dump(
- [
- make_fizzbaz(123, name="Test Fizzbaz 1"),
- > make_fizzbaz(456, name="Test Fizzbaz 2"),
- ]
- )
- .data
- )
- E AttributeError: 'list' object has no attribute 'data'
- app/fizz/fizzbaz/controller_test.py:37: AttributeError
- ___________________________________________ TestFizzbazResource.test_post ____________________________________________
- self = <app.fizz.fizzbaz.controller_test.TestFizzbazResource object at 0x7fbcc93ffc10>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(
- FizzbazService, "create", lambda create_request: Fizzbaz(**create_request)
- )
- def test_post(self, client: FlaskClient): # noqa
- with client:
- payload = dict(name="Test fizzbaz", purpose="Test purpose")
- result = client.post(f"/api/{BASE_ROUTE}/fizzbaz/", json=payload).get_json()
- expected = (
- FizzbazSchema()
- > .dump(Fizzbaz(name=payload["name"], purpose=payload["purpose"]))
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/fizz/fizzbaz/controller_test.py:55: AttributeError
- ___________________________________________ TestFizzbazIdResource.test_put ___________________________________________
- self = <app.fizz.fizzbaz.controller_test.TestFizzbazIdResource object at 0x7fbcc938db10>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(FizzbazService, "get_by_id", lambda id: make_fizzbaz(id=id))
- @patch.object(FizzbazService, "update", fake_update)
- def test_put(self, client: FlaskClient): # noqa
- with client:
- result = client.put(
- f"/api/{BASE_ROUTE}/fizzbaz/123",
- json={"name": "New Fizzbaz", "purpose": "New purpose"},
- ).get_json()
- expected = (
- FizzbazSchema()
- .dump(
- > Fizzbaz(fizzbaz_id=123, name="New Fizzbaz", purpose="New purpose")
- )
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/fizz/fizzbaz/controller_test.py:95: AttributeError
- ______________________________________________ test_FizzbazSchema_works ______________________________________________
- schema = <FizzbazSchema(many=False)>
- def test_FizzbazSchema_works(schema: FizzbazSchema):
- params: FizzbazInterface = schema.load(
- > {"fizzbazId": "123", "name": "Test fizzbaz", "purpose": "Test purpose"}
- ).data
- E AttributeError: 'dict' object has no attribute 'data'
- app/fizz/fizzbaz/schema_test.py:19: AttributeError
- ____________________________________________ TestDoodadResource.test_get _____________________________________________
- self = <app.other_api.doodad.controller_test.TestDoodadResource object at 0x7fbcc927ccd0>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(
- DoodadService,
- "get_all",
- lambda: [
- make_doodad(123, name="Test Doodad 1"),
- make_doodad(456, name="Test Doodad 2"),
- ],
- )
- def test_get(self, client: FlaskClient): # noqa
- with client:
- results = client.get(
- f"/api/{BASE_ROUTE}/doodad", follow_redirects=True
- ).get_json()
- expected = (
- DoodadSchema(many=True)
- .dump(
- [
- make_doodad(123, name="Test Doodad 1"),
- > make_doodad(456, name="Test Doodad 2"),
- ]
- )
- .data
- )
- E AttributeError: 'list' object has no attribute 'data'
- app/other_api/doodad/controller_test.py:37: AttributeError
- ____________________________________________ TestDoodadResource.test_post ____________________________________________
- self = <app.other_api.doodad.controller_test.TestDoodadResource object at 0x7fbcc91ec290>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(
- DoodadService, "create", lambda create_request: Doodad(**create_request)
- )
- def test_post(self, client: FlaskClient): # noqa
- with client:
- payload = dict(name="Test doodad", purpose="Test purpose")
- result = client.post(f"/api/{BASE_ROUTE}/doodad/", json=payload).get_json()
- expected = (
- DoodadSchema()
- > .dump(Doodad(name=payload["name"], purpose=payload["purpose"]))
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/other_api/doodad/controller_test.py:55: AttributeError
- ___________________________________________ TestDoodadIdResource.test_put ____________________________________________
- self = <app.other_api.doodad.controller_test.TestDoodadIdResource object at 0x7fbcc916b2d0>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(DoodadService, "get_by_id", lambda id: make_doodad(id=id))
- @patch.object(DoodadService, "update", fake_update)
- def test_put(self, client: FlaskClient): # noqa
- with client:
- result = client.put(
- f"/api/{BASE_ROUTE}/doodad/123",
- json={"name": "New Doodad", "purpose": "New purpose"},
- ).get_json()
- expected = (
- DoodadSchema()
- > .dump(Doodad(doodad_id=123, name="New Doodad", purpose="New purpose"))
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/other_api/doodad/controller_test.py:94: AttributeError
- ______________________________________________ test_DoodadSchema_works _______________________________________________
- schema = <DoodadSchema(many=False)>
- def test_DoodadSchema_works(schema: DoodadSchema):
- params: DoodadInterface = schema.load(
- > {"doodadId": "123", "name": "Test doodad", "purpose": "Test purpose"}
- ).data
- E AttributeError: 'dict' object has no attribute 'data'
- app/other_api/doodad/schema_test.py:19: AttributeError
- ____________________________________________ TestWhatsitResource.test_get ____________________________________________
- self = <app.other_api.whatsit.controller_test.TestWhatsitResource object at 0x7fbcc906eb10>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(
- WhatsitService,
- "get_all",
- lambda: [
- make_whatsit(123, name="Test Whatsit 1"),
- make_whatsit(456, name="Test Whatsit 2"),
- ],
- )
- def test_get(self, client: FlaskClient): # noqa
- with client:
- results = client.get(
- f"/api/{BASE_ROUTE}/whatsit", follow_redirects=True
- ).get_json()
- expected = (
- WhatsitSchema(many=True)
- .dump(
- [
- make_whatsit(123, name="Test Whatsit 1"),
- > make_whatsit(456, name="Test Whatsit 2"),
- ]
- )
- .data
- )
- E AttributeError: 'list' object has no attribute 'data'
- app/other_api/whatsit/controller_test.py:37: AttributeError
- ___________________________________________ TestWhatsitResource.test_post ____________________________________________
- self = <app.other_api.whatsit.controller_test.TestWhatsitResource object at 0x7fbcc904db90>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(
- WhatsitService, "create", lambda create_request: Whatsit(**create_request)
- )
- def test_post(self, client: FlaskClient): # noqa
- with client:
- payload = dict(name="Test whatsit", purpose="Test purpose")
- result = client.post(f"/api/{BASE_ROUTE}/whatsit/", json=payload).get_json()
- expected = (
- WhatsitSchema()
- > .dump(Whatsit(name=payload["name"], purpose=payload["purpose"]))
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/other_api/whatsit/controller_test.py:55: AttributeError
- ___________________________________________ TestWhatsitIdResource.test_put ___________________________________________
- self = <app.other_api.whatsit.controller_test.TestWhatsitIdResource object at 0x7fbcc8fd50d0>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(WhatsitService, "get_by_id", lambda id: make_whatsit(id=id))
- @patch.object(WhatsitService, "update", fake_update)
- def test_put(self, client: FlaskClient): # noqa
- with client:
- result = client.put(
- f"/api/{BASE_ROUTE}/whatsit/123",
- json={"name": "New Whatsit", "purpose": "New purpose"},
- ).get_json()
- expected = (
- WhatsitSchema()
- .dump(
- > Whatsit(whatsit_id=123, name="New Whatsit", purpose="New purpose")
- )
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/other_api/whatsit/controller_test.py:95: AttributeError
- ______________________________________________ test_WhatsitSchema_works ______________________________________________
- schema = <WhatsitSchema(many=False)>
- def test_WhatsitSchema_works(schema: WhatsitSchema):
- params: WhatsitInterface = schema.load(
- > {"whatsitId": "123", "name": "Test whatsit", "purpose": "Test purpose"}
- ).data
- E AttributeError: 'dict' object has no attribute 'data'
- app/other_api/whatsit/schema_test.py:19: AttributeError
- ____________________________________________ TestWidgetResource.test_get _____________________________________________
- self = <app.widget.controller_test.TestWidgetResource object at 0x7fbcc8e80c90>, client = <FlaskClient <Flask 'app'>>
- @patch.object(
- WidgetService,
- "get_all",
- lambda: [
- make_widget(123, name="Test Widget 1"),
- make_widget(456, name="Test Widget 2"),
- ],
- )
- def test_get(self, client: FlaskClient): # noqa
- with client:
- results = client.get(f"/api/{BASE_ROUTE}", follow_redirects=True).get_json()
- expected = (
- WidgetSchema(many=True)
- .dump(
- [
- make_widget(123, name="Test Widget 1"),
- > make_widget(456, name="Test Widget 2"),
- ]
- )
- .data
- )
- E AttributeError: 'list' object has no attribute 'data'
- app/widget/controller_test.py:35: AttributeError
- ____________________________________________ TestWidgetResource.test_post ____________________________________________
- self = <app.widget.controller_test.TestWidgetResource object at 0x7fbcc8e36990>, client = <FlaskClient <Flask 'app'>>
- @patch.object(
- WidgetService, "create", lambda create_request: Widget(**create_request)
- )
- def test_post(self, client: FlaskClient): # noqa
- with client:
- payload = dict(name="Test widget", purpose="Test purpose")
- result = client.post(f"/api/{BASE_ROUTE}/", json=payload).get_json()
- expected = (
- WidgetSchema()
- > .dump(Widget(name=payload["name"], purpose=payload["purpose"]))
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/widget/controller_test.py:53: AttributeError
- ___________________________________________ TestWidgetIdResource.test_put ____________________________________________
- self = <app.widget.controller_test.TestWidgetIdResource object at 0x7fbcc8dc14d0>
- client = <FlaskClient <Flask 'app'>>
- @patch.object(WidgetService, "get_by_id", lambda id: make_widget(id=id))
- @patch.object(WidgetService, "update", fake_update)
- def test_put(self, client: FlaskClient): # noqa
- with client:
- result = client.put(
- f"/api/{BASE_ROUTE}/123",
- json={"name": "New Widget", "purpose": "New purpose"},
- ).get_json()
- expected = (
- WidgetSchema()
- > .dump(Widget(widget_id=123, name="New Widget", purpose="New purpose"))
- .data
- )
- E AttributeError: 'dict' object has no attribute 'data'
- app/widget/controller_test.py:93: AttributeError
- ______________________________________________ test_WidgetSchema_works _______________________________________________
- schema = <WidgetSchema(many=False)>
- def test_WidgetSchema_works(schema: WidgetSchema):
- params: WidgetInterface = schema.load(
- > {"widgetId": "123", "name": "Test widget", "purpose": "Test purpose"}
- ).data
- E AttributeError: 'dict' object has no attribute 'data'
- app/widget/schema_test.py:19: AttributeError
- =========================================== 20 failed, 58 passed in 1.22s ============================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement