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
aa05eaf9
Commit
aa05eaf9
authored
Jun 15, 2012
by
Gabriel Falcao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing a bug with using email addresses in steps
parent
78875556
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
lettuce/core.py
+6
-3
tests/unit/test_feature_parser.py
+6
-3
tests/unit/test_main.py
+1
-1
No files found.
lettuce/core.py
View file @
aa05eaf9
...
@@ -708,9 +708,11 @@ class Scenario(object):
...
@@ -708,9 +708,11 @@ class Scenario(object):
def
try_finding_with
(
regex
):
def
try_finding_with
(
regex
):
found
=
regex
.
search
(
original_string
)
found
=
regex
.
search
(
original_string
)
if
found
:
if
found
:
tag_lines
=
found
.
group
()
.
splitlines
()
tag_lines
=
found
.
group
()
.
splitlines
()
return
list
(
chain
(
*
map
(
self
.
_extract_tag
,
tag_lines
)))
tags
=
list
(
chain
(
*
map
(
self
.
_extract_tag
,
tag_lines
)))
return
tags
for
regex
in
regexes
:
for
regex
in
regexes
:
found
=
try_finding_with
(
regex
)
found
=
try_finding_with
(
regex
)
...
@@ -720,8 +722,9 @@ class Scenario(object):
...
@@ -720,8 +722,9 @@ class Scenario(object):
return
[]
return
[]
def
_extract_tag
(
self
,
item
):
def
_extract_tag
(
self
,
item
):
regex
=
re
.
compile
(
r'[@](\S+)'
)
regex
=
re
.
compile
(
r'(?:(?:^|\s+)[@]([^@\s]+))'
)
return
regex
.
findall
(
item
)
found
=
regex
.
findall
(
item
)
return
found
def
_resolve_steps
(
self
,
steps
,
outlines
,
with_file
,
original_string
):
def
_resolve_steps
(
self
,
steps
,
outlines
,
with_file
,
original_string
):
for
outline
in
outlines
:
for
outline
in
outlines
:
...
...
tests/unit/test_feature_parser.py
View file @
aa05eaf9
...
@@ -153,7 +153,7 @@ Feature: Yay tags
...
@@ -153,7 +153,7 @@ Feature: Yay tags
@many @other
@many @other
@basic
@basic
@tags @here @:)
@tags @here @:)
Scenario:
Holy tag, Batman
Scenario:
Double Yay
Given this scenario has tags
Given this scenario has tags
Then it can be inspected from within the object
Then it can be inspected from within the object
"""
"""
...
@@ -175,7 +175,7 @@ Feature: Yay tags and many scenarios
...
@@ -175,7 +175,7 @@ Feature: Yay tags and many scenarios
"""
"""
FEATURE13
=
"""
FEATURE13
=
'''
Feature: correct matching
Feature: correct matching
@runme
@runme
Scenario: Holy tag, Batman
Scenario: Holy tag, Batman
...
@@ -184,17 +184,20 @@ Feature: correct matching
...
@@ -184,17 +184,20 @@ Feature: correct matching
Scenario: This has no tags
Scenario: This has no tags
Given this scenario has tags
Given this scenario has tags
When I fill my email with gabriel@lettuce.it
Then it can be inspected from within the object
Then it can be inspected from within the object
@slow
@slow
Scenario: this is slow
Scenario: this is slow
Given this scenario has tags
Given this scenario has tags
When I fill my email with "gabriel@lettuce.it"
Then it can be inspected from within the object
Then it can be inspected from within the object
Scenario: Also without tags
Scenario: Also without tags
Given this scenario has tags
Given this scenario has tags
When I fill my email with 'gabriel@lettuce.it'
Then it can be inspected from within the object
Then it can be inspected from within the object
"""
'''
FEATURE14
=
"""
FEATURE14
=
"""
Feature: Extra whitespace feature
Feature: Extra whitespace feature
...
...
tests/unit/test_main.py
View file @
aa05eaf9
...
@@ -22,7 +22,7 @@ from mox import Mox
...
@@ -22,7 +22,7 @@ from mox import Mox
def
test_has_version
():
def
test_has_version
():
"A nice python module is supposed to have a version"
"A nice python module is supposed to have a version"
assert_equals
(
lettuce
.
version
,
'0.2.
0
'
)
assert_equals
(
lettuce
.
version
,
'0.2.
3
'
)
def
test_has_release
():
def
test_has_release
():
...
...
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