forked from shibing624/python-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_utils.py
More file actions
26 lines (21 loc) · 669 Bytes
/
test_utils.py
File metadata and controls
26 lines (21 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-
"""
@author:XuMing([email protected])
@description:
"""
import os
import codecs
def get_default_rendering_file_content(file_name="render.html"):
"""
Simply returns the content render.html
"""
with codecs.open(file_name, "r", "utf-8") as f:
return f.read()
def get_fixture_content(file_name):
fixture_file = os.path.join("fixtures", file_name)
with codecs.open(fixture_file, "r", "utf-8") as f:
return f.read()
def store_fixture_content(file_name, content):
fixture_file = os.path.join("fixtures", file_name)
with codecs.open(fixture_file, "w", "utf-8") as f:
return f.write(content)