mirror of
https://github.com/huashengdun/webssh.git
synced 2026-02-14 11:49:50 +00:00
Updated tests/utils.py
This commit is contained in:
@@ -41,10 +41,11 @@ def get_content_type(filename):
|
|||||||
|
|
||||||
|
|
||||||
def read_file(path, encoding='utf-8'):
|
def read_file(path, encoding='utf-8'):
|
||||||
data = open(path, 'rb').read()
|
with open(path, 'rb') as f:
|
||||||
if encoding is None:
|
data = f.read()
|
||||||
return data
|
if encoding is None:
|
||||||
return data.decode(encoding)
|
return data
|
||||||
|
return data.decode(encoding)
|
||||||
|
|
||||||
|
|
||||||
def make_tests_data_path(filename):
|
def make_tests_data_path(filename):
|
||||||
|
|||||||
Reference in New Issue
Block a user