aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorBonfaceKilz2020-11-20 20:03:23 +0300
committerBonfaceKilz2020-11-20 20:03:23 +0300
commit8fc58655c9b98e816f31e4a4f99b6879fe304bca (patch)
treeeb1c507f92f2817f68e1b6acd3417154192927d5 /wqflask
parente323c52889cfbab7f152e4969f6e2b528768587a (diff)
downloadgenenetwork2-8fc58655c9b98e816f31e4a4f99b6879fe304bca.tar.gz
Replace mockobject with dataclasses
* wqflask/tests/unit/wqflask/test_markdown_routes.py (MockRequests404): Use dataclasses. (MockRequests200): Ditto.
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/tests/unit/wqflask/test_markdown_routes.py18
1 files changed, 8 insertions, 10 deletions
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"""