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
9924a636
Commit
9924a636
authored
May 29, 2011
by
Gabriel Falcao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small refactoring on tests
parent
aea3661b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
tests/unit/test_core.py
+1
-1
tests/unit/test_strings.py
+13
-4
No files found.
tests/unit/test_core.py
View file @
9924a636
...
...
@@ -37,7 +37,7 @@ def test_step_definition():
definition
=
core
.
StepDefinition
(
"FOO BAR"
,
dumb
)
assert_equals
(
definition
.
function
,
dumb
)
assert_equals
(
definition
.
file
,
core
.
fs
.
relpath
(
__file__
)
.
rstrip
(
"c"
))
assert_equals
(
definition
.
line
,
3
4
)
assert_equals
(
definition
.
line
,
3
5
)
def
test_step_description
():
...
...
tests/unit/test_strings.py
View file @
9924a636
...
...
@@ -317,7 +317,7 @@ def test_parse_hashes_allow_empty():
def
test_identifies_tag_lines
():
"strings.extract_tags_from_line
simple case
"
"strings.extract_tags_from_line
not matching anything
"
# No tags tests
tags
=
strings
.
extract_tags_from_line
(
""
)
assert_equals
(
tags
,
None
)
...
...
@@ -327,9 +327,14 @@ def test_identifies_tag_lines():
assert_equals
(
tags
,
None
)
tags
=
strings
.
extract_tags_from_line
(
" | example step hash | line |"
)
assert_equals
(
tags
,
None
)
tags
=
strings
.
extract_tags_from_line
(
" | example step hash | line @with | @tag like |"
)
tags
=
strings
.
extract_tags_from_line
(
" | example step hash | line @with | @tag like |"
)
assert_equals
(
tags
,
None
)
# Now for positive tests
def
test_finding_tags
():
"strings.extract_tags_from_line matching simple cases"
tags
=
strings
.
extract_tags_from_line
(
"@one"
)
assert_equals
(
tags
,
[
"one"
])
tags
=
strings
.
extract_tags_from_line
(
" @one "
)
...
...
@@ -340,11 +345,15 @@ def test_identifies_tag_lines():
assert_equals
(
tags
,
[
"one"
,
"two"
,
"three"
])
tags
=
strings
.
extract_tags_from_line
(
" @one.two @three_four "
)
assert_equals
(
tags
,
[
"one.two"
,
"three_four"
])
# Odd tests
def
test_dont_find_tags_in_weird_cases
():
"don't find tags in weird cases"
tags
=
strings
.
extract_tags_from_line
(
" @one two @three @four "
)
assert_equals
(
tags
,
None
)
def
test_consume_tag_lines
():
"strings.consume_tags_lines simple case"
# No tags
...
...
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