From 8fc58655c9b98e816f31e4a4f99b6879fe304bca Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Fri, 20 Nov 2020 20:03:23 +0300 Subject: Replace mockobject with dataclasses * wqflask/tests/unit/wqflask/test_markdown_routes.py (MockRequests404): Use dataclasses. (MockRequests200): Ditto. --- wqflask/tests/unit/wqflask/test_markdown_routes.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'wqflask/tests') diff --git a/wqflask/tests/unit/wqflask/test_markdown_routes.py b/wqflask/tests/unit/wqflask/test_markdown_routes.py index 2d403d04..90e0f17c 100644 --- a/wqflask/tests/unit/wqflask/test_markdown_routes.py +++ b/wqflask/tests/unit/wqflask/test_markdown_routes.py @@ -3,28 +3,26 @@ import unittest from unittest import mock +from dataclasses import dataclass from wqflask.markdown_routes import render_markdown +@dataclass class MockRequests404: - @property - def status_code(self): - return 404 + status_code: int = 404 -class MockRequests200: - @property - def status_code(self): - return 200 - @property - def content(self): - return b""" +@dataclass +class MockRequests200: + status_code: int = 200 + content: str = b""" # Glossary This is some content ## Sub-heading This is another sub-heading""" + class TestMarkdownRoutesFunctions(unittest.TestCase): """Test cases for functions in markdown_routes""" -- cgit v1.2.3