Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
逆流者blog
python3-learn
提交
b2fd5d21
P
python3-learn
项目概览
逆流者blog
/
python3-learn
通知
23
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
P
python3-learn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b2fd5d21
编写于
11月 21, 2020
作者:
逆流者blog
🇨🇳
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
py
上级
eeb71511
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
43 addition
and
43 deletion
+43
-43
base/language_survey.py
base/language_survey.py
+4
-4
base/test_survey.py
base/test_survey.py
+39
-39
未找到文件。
base/language_survey.py
浏览文件 @
b2fd5d21
base/test_survey.py
浏览文件 @
b2fd5d21
...
...
@@ -9,32 +9,32 @@ class TestAnonymousSurvey(unittest.TestCase):
# question = "What language did you first learn to speak?"
# my_survey = AnonymousSurvey(question)
# my_survey.store_response('English')
#
# self.assertIn("English", my_survey.responses)
# def test_store_three_responses(self):
#
"""测试三个答案会被妥善地存储"""
#
question = "What language did you first learn to speak?"
#
my_survey = AnonymousSurvey(question)
#
responses = ['English', 'Spanish', 'Mandarin']
#
for response in responses:
#
my_survey.store_response(response)
#
for response in responses:
#
self.assertIn(response, my_survey.responses)
def
setUp
(
self
):
# def test_store_three_responses(self):
#
"""测试三个答案会被妥善地存储"""
#
question = "What language did you first learn to speak?"
#
my_survey = AnonymousSurvey(question)
#
responses = ['English', 'Spanish', 'Mandarin']
#
for response in responses:
#
my_survey.store_response(response)
#
#
for response in responses:
#
self.assertIn(response, my_survey.responses)
def
setUp
(
self
):
"""创建一个调查对象和一组答案, 供使用的测试方法使用"""
question
=
"What language did you first learn to speak?"
self
.
my_survey
=
AnonymousSurvey
(
question
)
self
.
responses
=
[
'English'
,
'Spanish'
,
'Mandarin'
]
def
test_store_single_response
(
self
):
def
test_store_single_response
(
self
):
"""测试单个答案会被妥善的存储"""
self
.
my_survey
.
store_response
(
self
.
responses
[
0
])
self
.
assertIn
(
self
.
responses
[
0
],
self
.
my_survey
.
responses
)
def
test_store_three_responses
(
self
):
def
test_store_three_responses
(
self
):
"""测试三个答案会被妥善地存储"""
for
response
in
self
.
responses
:
self
.
my_survey
.
store_response
(
response
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录