Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
197e62c2
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,发现更多精彩内容 >>
未验证
提交
197e62c2
编写于
4月 13, 2018
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'apahim/fix_astring_safepath'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
2c732c00
78abb53c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
9 deletion
+9
-9
avocado/utils/astring.py
avocado/utils/astring.py
+3
-3
selftests/unit/test_test.py
selftests/unit/test_test.py
+6
-6
未找到文件。
avocado/utils/astring.py
浏览文件 @
197e62c2
...
@@ -35,14 +35,14 @@ from six.moves import xrange as range
...
@@ -35,14 +35,14 @@ from six.moves import xrange as range
#: String containing all fs-unfriendly chars (Windows-fat/Linux-ext3)
#: String containing all fs-unfriendly chars (Windows-fat/Linux-ext3)
FS_UNSAFE_CHARS
=
'<>:"/
\\
|?*'
FS_UNSAFE_CHARS
=
'<>:"/
\\
|?*
;
'
# Translate table to replace fs-unfriendly chars
# Translate table to replace fs-unfriendly chars
if
PY3
:
if
PY3
:
_FS_TRANSLATE
=
bytes
.
maketrans
(
bytes
(
FS_UNSAFE_CHARS
,
"ascii"
),
_FS_TRANSLATE
=
bytes
.
maketrans
(
bytes
(
FS_UNSAFE_CHARS
,
"ascii"
),
b
'_________'
)
b
'_________
_
'
)
else
:
else
:
_FS_TRANSLATE
=
string
.
maketrans
(
FS_UNSAFE_CHARS
,
'_________'
)
_FS_TRANSLATE
=
string
.
maketrans
(
FS_UNSAFE_CHARS
,
'_________
_
'
)
def
bitlist_to_string
(
data
):
def
bitlist_to_string
(
data
):
...
...
selftests/unit/test_test.py
浏览文件 @
197e62c2
...
@@ -79,13 +79,13 @@ class TestClassTestUnit(unittest.TestCase):
...
@@ -79,13 +79,13 @@ class TestClassTestUnit(unittest.TestCase):
# Everything fits
# Everything fits
check
(
1
,
"a"
*
253
,
None
,
"1-"
+
(
"a"
*
253
))
check
(
1
,
"a"
*
253
,
None
,
"1-"
+
(
"a"
*
253
))
check
(
2
,
"a"
*
251
,
{
"variant_id"
:
1
},
"2-"
+
(
"a"
*
251
)
+
"
;
1"
)
check
(
2
,
"a"
*
251
,
{
"variant_id"
:
1
},
"2-"
+
(
"a"
*
251
)
+
"
_
1"
)
check
(
99
,
"a"
*
249
,
{
"variant_id"
:
88
},
"99-"
+
(
"a"
*
249
)
+
"
;
88"
)
check
(
99
,
"a"
*
249
,
{
"variant_id"
:
88
},
"99-"
+
(
"a"
*
249
)
+
"
_
88"
)
# Shrink name
# Shrink name
check
(
3
,
"a"
*
252
,
{
"variant_id"
:
1
},
"3-"
+
(
'a'
*
251
)
+
"
;
1"
)
check
(
3
,
"a"
*
252
,
{
"variant_id"
:
1
},
"3-"
+
(
'a'
*
251
)
+
"
_
1"
)
# Shrink variant
# Shrink variant
check
(
"a"
*
253
,
"whatever"
,
{
"variant_id"
:
99
},
"a"
*
253
+
"
;
9"
)
check
(
"a"
*
253
,
"whatever"
,
{
"variant_id"
:
99
},
"a"
*
253
+
"
_
9"
)
check
(
"a"
*
254
,
"whatever"
,
{
"variant_id"
:
99
},
"a"
*
254
+
"
;
"
)
check
(
"a"
*
254
,
"whatever"
,
{
"variant_id"
:
99
},
"a"
*
254
+
"
_
"
)
# No variant
# No variant
tst
=
check
(
"a"
*
255
,
"whatever"
,
{
"variant_id"
:
"whatever-else"
},
tst
=
check
(
"a"
*
255
,
"whatever"
,
{
"variant_id"
:
"whatever-else"
},
"a"
*
255
)
"a"
*
255
)
...
@@ -375,7 +375,7 @@ class TestID(unittest.TestCase):
...
@@ -375,7 +375,7 @@ class TestID(unittest.TestCase):
variant
=
{
'variant_id'
:
variant_id
}
variant
=
{
'variant_id'
:
variant_id
}
test_id
=
test
.
TestID
(
uid
,
name
,
variant
=
variant
)
test_id
=
test
.
TestID
(
uid
,
name
,
variant
=
variant
)
self
.
assertEqual
(
test_id
.
uid
,
1
)
self
.
assertEqual
(
test_id
.
uid
,
1
)
self
.
assertEqual
(
test_id
.
str_filesystem
,
'%s
;
%s'
%
(
uid
,
variant_id
[:
253
]))
self
.
assertEqual
(
test_id
.
str_filesystem
,
'%s
_
%s'
%
(
uid
,
variant_id
[:
253
]))
self
.
assertIs
(
test_id
.
variant
,
variant_id
)
self
.
assertIs
(
test_id
.
variant
,
variant_id
)
self
.
assertEqual
(
test_id
.
str_variant
,
";%s"
%
variant_id
)
self
.
assertEqual
(
test_id
.
str_variant
,
";%s"
%
variant_id
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录