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
f0b13420
Commit
f0b13420
authored
Jun 13, 2012
by
Gabriel Falcao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing exclusionary tags behavior
parent
dba55f98
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
lettuce/core.py
+9
-4
tests/unit/test_scenario_parsing.py
+11
-0
No files found.
lettuce/core.py
View file @
f0b13420
...
@@ -583,14 +583,19 @@ class Scenario(object):
...
@@ -583,14 +583,19 @@ class Scenario(object):
if
tags
is
None
:
if
tags
is
None
:
return
True
return
True
if
not
self
.
tags
:
has_exclusionary_tags
=
any
([
t
.
startswith
(
'-'
)
for
t
in
tags
])
if
not
self
.
tags
and
not
has_exclusionary_tags
:
return
False
return
False
matched
=
[]
matched
=
[]
for
tag
in
self
.
tags
:
if
isinstance
(
self
.
tags
,
list
):
if
tag
in
tags
:
for
tag
in
self
.
tags
:
return
True
if
tag
in
tags
:
return
True
else
:
self
.
tags
=
[]
for
tag
in
tags
:
for
tag
in
tags
:
exclude
=
tag
.
startswith
(
'-'
)
exclude
=
tag
.
startswith
(
'-'
)
...
...
tests/unit/test_scenario_parsing.py
View file @
f0b13420
...
@@ -497,6 +497,17 @@ def test_scenario_matches_tags_excluding():
...
@@ -497,6 +497,17 @@ def test_scenario_matches_tags_excluding():
assert
scenario
.
matches_tags
([
'-foobar'
])
assert
scenario
.
matches_tags
([
'-foobar'
])
def
test_scenario_matches_tags_excluding_when_scenario_has_no_tags
():
(
"When Scenario#matches_tags is called for a scenario "
"that has no tags and the given match is a exclusionary tag"
)
scenario
=
Scenario
.
from_string
(
SCENARIO1
,
original_string
=
(
SCENARIO1
.
strip
()))
assert
scenario
.
matches_tags
([
'-nope'
,
'-neither'
])
def
test_scenario_matches_tags_excluding_fuzzywuzzy
():
def
test_scenario_matches_tags_excluding_fuzzywuzzy
():
(
"When Scenario#matches_tags is called with a member starting with -~ "
(
"When Scenario#matches_tags is called with a member starting with -~ "
"it will exclude that tag from that fuzzywuzzy match"
)
"it will exclude that tag from that fuzzywuzzy match"
)
...
...
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