yhttp-dev 3.1.2__tar.gz → 3.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/PKG-INFO +1 -1
- yhttp_dev-3.2.4/yhttp/dev/__init__.py +1 -0
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/yhttp/dev/fixtures.py +30 -0
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/yhttp_dev.egg-info/PKG-INFO +1 -1
- yhttp_dev-3.1.2/yhttp/dev/__init__.py +0 -1
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/LICENSE +0 -0
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/README.md +0 -0
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/setup.cfg +0 -0
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/setup.py +0 -0
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/yhttp_dev.egg-info/SOURCES.txt +0 -0
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/yhttp_dev.egg-info/dependency_links.txt +0 -0
- {yhttp_dev-3.1.2 → yhttp_dev-3.2.4}/yhttp_dev.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '3.2.4'
|
|
@@ -3,6 +3,7 @@ import shutil
|
|
|
3
3
|
import socket
|
|
4
4
|
import tempfile
|
|
5
5
|
import datetime
|
|
6
|
+
import contextlib
|
|
6
7
|
from unittest.mock import patch
|
|
7
8
|
|
|
8
9
|
import pytest
|
|
@@ -129,5 +130,34 @@ def redis():
|
|
|
129
130
|
hashtable = self.maindict.setdefault(key, {})
|
|
130
131
|
return hashtable[field]
|
|
131
132
|
|
|
133
|
+
def close(self):
|
|
134
|
+
# Do nothing here, this methog is needed for just compatibiliy.
|
|
135
|
+
pass
|
|
136
|
+
|
|
132
137
|
with patch('redis.Redis', new=RedisMock) as p:
|
|
133
138
|
yield p
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@pytest.fixture(scope='session')
|
|
142
|
+
def htmlfile():
|
|
143
|
+
@contextlib.contextmanager
|
|
144
|
+
def create(filename, title, cssfile=None):
|
|
145
|
+
with open(filename, 'a') as file:
|
|
146
|
+
file.truncate(0)
|
|
147
|
+
file.write(
|
|
148
|
+
'<!DOCTYPE html>\n'
|
|
149
|
+
'<html lang="en">\n'
|
|
150
|
+
'<head>\n'
|
|
151
|
+
'<meta charset="utf-8" />\n'
|
|
152
|
+
f'<title>{title}</title>\n'
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
if cssfile:
|
|
156
|
+
file.write(f'<link rel="stylesheet" href="{cssfile}" '
|
|
157
|
+
'type="text/css" />\n')
|
|
158
|
+
|
|
159
|
+
file.write('</head><body>\n')
|
|
160
|
+
yield file
|
|
161
|
+
file.write('</body></html>')
|
|
162
|
+
|
|
163
|
+
return create
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '3.1.2'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|