Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
105
Merge Requests
105
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
9c77558a
Commit
9c77558a
authored
Jan 10, 2024
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
af031be2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
software/ors-amarisoft/test/test.py
software/ors-amarisoft/test/test.py
+37
-0
No files found.
software/ors-amarisoft/test/test.py
View file @
9c77558a
...
@@ -768,5 +768,42 @@ def _matchCollect(v, vok):
...
@@ -768,5 +768,42 @@ def _matchCollect(v, vok):
assert
type
(
v
)
is
not
tuple
,
v
assert
type
(
v
)
is
not
tuple
,
v
return
v
return
v
class
TestAssertMatch
(
unittest
.
TestCase
):
def
test_assertMatch
(
t
):
y
,
n
=
True
,
False
testv
=
[
# [](match, v, vok)
(
y
,
12
,
12
),
(
n
,
12
,
13
),
(
n
,
12
,
'12'
),
(
y
,
'a'
,
'a'
),
(
n
,
'a'
,
'ab'
),
(
y
,
[],
[]),
(
n
,
[],
[
1
]),
(
y
,
[
1
],
[
1
]),
(
n
,
[
1
,
2
],
[
1
]),
(
y
,
[
1
,
2
],
[
1
,
2
]),
(
n
,
[
1
,
2
],
[
'a'
,
2
]),
(
y
,
{},
{}),
(
y
,
{
'a'
:
1
},
{}),
(
y
,
{
'a'
:
1
},
{
'a'
:
1
}),
(
n
,
{
'a'
:
1
},
{
'a'
:
2
}),
(
n
,
{
'a'
:
1
},
{
'a'
:
NO
}),
(
y
,
{},
{
'a'
:
NO
}),
(
y
,
{
'b'
:
2
},
{
'a'
:
NO
}),
(
n
,
{
'a'
:
1
,
'b'
:
2
},
{
'a'
:
NO
}),
(
n
,
{
'a'
:
1
,
'b'
:
2
},
{
'a'
:
NO
,
'b'
:
2
}),
(
y
,
{
'a'
:
1
,
'b'
:
2
},
{
'b'
:
2
}),
(
y
,
{
'a'
:
[
1
,
2
,
{
'aa'
:
33
,
'bb'
:
44
}]},
{
'a'
:
[
1
,
2
,
{
'aa'
:
33
,
'cc'
:
NO
}]},
(
n
,
{
'a'
:
[
1
,
2
,
{
'aa'
:
33
,
'bb'
:
44
}]},
{
'a'
:
[
1
,
2
,
{
'aa'
:
35
,
'cc'
:
NO
}]},
]
for
mok
,
v
,
vok
in
testv
:
if
mok
:
assertMatch
(
t
,
v
,
vok
)
else
:
t
.
assertRaises
(
t
.
failureException
,
assertMatch
,
t
,
v
,
vok
)
# XXX test for assertMatch
# XXX test for assertMatch
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment