Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs1-25sp
project02
Commits
8e117e4a
Commit
8e117e4a
authored
2 months ago
by
Adam Blank
Browse files
Options
Download
Email Patches
Plain Diff
Update test_get_hits.py
parent
8081863a
master
No related merge requests found
Pipeline
#118945
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/1.B/test_get_hits.py
+10
-10
tests/1.B/test_get_hits.py
with
10 additions
and
10 deletions
+10
-10
tests/1.B/test_get_hits.py
View file @
8e117e4a
...
@@ -3,18 +3,18 @@ from src.harder_computer import get_hits
...
@@ -3,18 +3,18 @@ from src.harder_computer import get_hits
from
src.shot
import
HIT
,
MISS
,
SUNK
from
src.shot
import
HIT
,
MISS
,
SUNK
from
tests.helpers.naming
import
apply_names
from
tests.helpers.naming
import
apply_names
@
pytest
.
mark
.
parametrize
(
'inputs, expected'
,
apply_names
(
'get_hits'
,
[
True
,
False
],
[
@
pytest
.
mark
.
parametrize
(
'inputs, expected'
,
apply_names
(
'get_hits'
,
[
True
,
False
],
[
([],
[]),
([],
[]),
([((
0
,
0
),
HIT
)],
[(
0
,
0
)]),
([((
0
,
0
),
HIT
)],
[(
0
,
0
)]),
([((
1
,
1
),
MISS
)],
[]),
([((
1
,
1
),
MISS
)],
[]),
([((
1
,
2
),
SUNK
)],
[]),
([((
1
,
2
),
SUNK
)],
[]),
([((
0
,
0
),
HIT
),
((
0
,
1
),
MISS
),
((
1
,
1
),
HIT
),
((
2
,
1
),
SUNK
)],
[(
0
,
0
),
(
1
,
1
)]),
([((
0
,
0
),
HIT
),
((
0
,
1
),
MISS
),
((
1
,
1
),
HIT
),
((
2
,
1
),
SUNK
)],
[(
0
,
0
),
(
1
,
1
)]),
([((
0
,
0
),
HIT
),
((
0
,
1
),
HIT
),
((
1
,
1
),
HIT
),
((
2
,
1
),
HIT
)],
[(
0
,
0
),
(
0
,
1
),
(
1
,
1
),
(
2
,
1
)]),
([((
0
,
0
),
HIT
),
((
0
,
1
),
HIT
),
((
1
,
1
),
HIT
),
([((
0
,
0
),
MISS
),
((
0
,
1
),
SUNK
),
((
1
,
1
),
MISS
),
((
2
,
1
),
HIT
)],
[(
2
,
1
)]),
((
2
,
1
),
HIT
)],
[(
0
,
0
),
(
0
,
1
),
(
1
,
1
),
(
2
,
1
)]),
([((
0
,
0
),
MISS
),
((
0
,
1
),
SUNK
),
((
1
,
1
),
MISS
),
((
2
,
1
),
HIT
)],
[(
2
,
1
)]),
]))
]))
def
test_get_hits
(
inputs
,
expected
):
def
test_get_hits
(
inputs
,
expected
):
result
=
get_hits
(
inputs
)
result
=
get_hits
(
inputs
)
assert
expected
==
result
,
(
f
"On an 8x8 board, the following inputs to the get_hits function:"
assert
expected
==
result
,
(
f
"On an 8x8 board, the following inputs to the get_hits "
f
"
\n
{
inputs
}
\n
lead to the following output:
\n
{
result
}
\n
when we "
f
"function:
\n
{
inputs
}
\n
lead to the expected output:
\n
{
expected
}
."
)
f
"expect:
\n
{
expected
}
."
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help