Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lettuce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
lettuce
Commits
b3a3ab73
Commit
b3a3ab73
authored
Mar 03, 2013
by
Kevin Stone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added failing test for `xunit_output` when using Background sections.
Signed-off-by: Kevin Stone <kevinastone@gmail.com>
parent
85a0db54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletions
+37
-1
tests/functional/test_xunit_output.py
+37
-1
No files found.
tests/functional/test_xunit_output.py
View file @
b3a3ab73
...
@@ -26,7 +26,7 @@ from lettuce import registry
...
@@ -26,7 +26,7 @@ from lettuce import registry
from
lettuce
import
Runner
from
lettuce
import
Runner
from
lettuce
import
xunit_output
from
lettuce
import
xunit_output
from
lxml
import
etree
from
lxml
import
etree
from
tests.functional.test_runner
import
feature_name
from
tests.functional.test_runner
import
feature_name
,
bg_feature_name
from
tests.asserts
import
prepare_stdout
from
tests.asserts
import
prepare_stdout
...
@@ -158,3 +158,39 @@ def test_xunit_output_with_no_steps():
...
@@ -158,3 +158,39 @@ def test_xunit_output_with_no_steps():
assert_equals
(
1
,
len
(
called
),
"Function not called"
)
assert_equals
(
1
,
len
(
called
),
"Function not called"
)
xunit_output
.
wrt_output
=
old
xunit_output
.
wrt_output
=
old
@with_setup
(
prepare_stdout
,
registry
.
clear
)
def
test_xunit_output_with_background_section
():
'Test xunit output with a background section in the feature'
called
=
[]
def
assert_correct_xml
(
filename
,
content
):
called
.
append
(
True
)
assert_xsd_valid
(
filename
,
content
)
root
=
etree
.
fromstring
(
content
)
assert_equals
(
root
.
get
(
"tests"
),
"1"
)
assert_equals
(
root
.
get
(
"failures"
),
"0"
)
assert_equals
(
len
(
root
.
getchildren
()),
2
)
passed1
,
passed2
=
root
.
findall
(
"testcase"
)
assert_equals
(
passed1
.
get
(
"name"
),
'Given the variable "X" holds 2'
)
assert_true
(
float
(
passed1
.
get
(
"time"
))
>
0
)
assert_equals
(
passed2
.
get
(
"name"
),
'Given the variable "X" is equal to 2'
)
assert_true
(
float
(
passed2
.
get
(
"time"
))
>
0
)
from
lettuce
import
step
@step
(
ur'the variable "(\w+)" holds (\d+)'
)
@step
(
ur'the variable "(\w+)" is equal to (\d+)'
)
def
just_pass
(
step
,
*
args
):
pass
filename
=
bg_feature_name
(
'simple'
)
old
=
xunit_output
.
wrt_output
xunit_output
.
wrt_output
=
assert_correct_xml
runner
=
Runner
(
filename
,
enable_xunit
=
True
)
runner
.
run
()
assert_equals
(
1
,
len
(
called
),
"Function not called"
)
xunit_output
.
wrt_output
=
old
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