Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
d60b0003
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d60b0003
编写于
8月 14, 2017
作者:
P
Paolo Bonzini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
specify text mode for NamedTemporaryFile
Signed-off-by:
N
Paolo Bonzini
<
pbonzini@redhat.com
>
上级
418bf92a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
5 deletion
+8
-5
avocado/plugins/diff.py
avocado/plugins/diff.py
+6
-3
selftests/unit/test_datadir.py
selftests/unit/test_datadir.py
+1
-1
selftests/unit/test_settings.py
selftests/unit/test_settings.py
+1
-1
未找到文件。
avocado/plugins/diff.py
浏览文件 @
d60b0003
...
@@ -201,14 +201,16 @@ class Diff(CLICmd):
...
@@ -201,14 +201,16 @@ class Diff(CLICmd):
if
getattr
(
args
,
'create_reports'
,
False
):
if
getattr
(
args
,
'create_reports'
,
False
):
self
.
std_diff_output
=
False
self
.
std_diff_output
=
False
prefix
=
'avocado_diff_%s_'
%
job1_id
[:
7
]
prefix
=
'avocado_diff_%s_'
%
job1_id
[:
7
]
tmp_file1
=
tempfile
.
NamedTemporaryFile
(
prefix
=
prefix
,
tmp_file1
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w'
,
prefix
=
prefix
,
suffix
=
'.txt'
,
suffix
=
'.txt'
,
delete
=
False
)
delete
=
False
)
tmp_file1
.
writelines
(
job1_results
)
tmp_file1
.
writelines
(
job1_results
)
tmp_file1
.
close
()
tmp_file1
.
close
()
prefix
=
'avocado_diff_%s_'
%
job2_id
[:
7
]
prefix
=
'avocado_diff_%s_'
%
job2_id
[:
7
]
tmp_file2
=
tempfile
.
NamedTemporaryFile
(
prefix
=
prefix
,
tmp_file2
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w'
,
prefix
=
prefix
,
suffix
=
'.txt'
,
suffix
=
'.txt'
,
delete
=
False
)
delete
=
False
)
tmp_file2
.
writelines
(
job2_results
)
tmp_file2
.
writelines
(
job2_results
)
...
@@ -220,7 +222,8 @@ class Diff(CLICmd):
...
@@ -220,7 +222,8 @@ class Diff(CLICmd):
getattr
(
args
,
'html'
,
None
)
is
None
):
getattr
(
args
,
'html'
,
None
)
is
None
):
prefix
=
'avocado_diff_%s_%s_'
%
(
job1_id
[:
7
],
job2_id
[:
7
])
prefix
=
'avocado_diff_%s_%s_'
%
(
job1_id
[:
7
],
job2_id
[:
7
])
tmp_file
=
tempfile
.
NamedTemporaryFile
(
prefix
=
prefix
,
tmp_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w'
,
prefix
=
prefix
,
suffix
=
'.html'
,
suffix
=
'.html'
,
delete
=
False
)
delete
=
False
)
...
...
selftests/unit/test_datadir.py
浏览文件 @
d60b0003
...
@@ -28,7 +28,7 @@ class DataDirTest(unittest.TestCase):
...
@@ -28,7 +28,7 @@ class DataDirTest(unittest.TestCase):
'test_dir = %(test_dir)s
\n
'
'test_dir = %(test_dir)s
\n
'
'data_dir = %(data_dir)s
\n
'
'data_dir = %(data_dir)s
\n
'
'logs_dir = %(logs_dir)s
\n
'
)
%
mapping
'logs_dir = %(logs_dir)s
\n
'
)
%
mapping
config_file
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
)
config_file
=
tempfile
.
NamedTemporaryFile
(
'w'
,
delete
=
False
)
config_file
.
write
(
temp_settings
)
config_file
.
write
(
temp_settings
)
config_file
.
close
()
config_file
.
close
()
return
(
mapping
,
config_file
.
name
)
return
(
mapping
,
config_file
.
name
)
...
...
selftests/unit/test_settings.py
浏览文件 @
d60b0003
...
@@ -19,7 +19,7 @@ home_path = ~
...
@@ -19,7 +19,7 @@ home_path = ~
class
SettingsTest
(
unittest
.
TestCase
):
class
SettingsTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
config_file
=
tempfile
.
NamedTemporaryFile
(
delete
=
False
)
self
.
config_file
=
tempfile
.
NamedTemporaryFile
(
'w'
,
delete
=
False
)
self
.
config_file
.
write
(
example_1
)
self
.
config_file
.
write
(
example_1
)
self
.
config_file
.
close
()
self
.
config_file
.
close
()
self
.
settings
=
settings
.
Settings
(
self
.
config_file
.
name
)
self
.
settings
=
settings
.
Settings
(
self
.
config_file
.
name
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录