Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs1-25sp
project02
Commits
e47eea05
Commit
e47eea05
authored
2 months ago
by
Adam Blank
Browse files
Options
Download
Email Patches
Plain Diff
Update test_9_is_valid_shot.py
parent
08f8f289
Pipeline
#118953
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/1.B/test_9_is_valid_shot.py
+5
-7
tests/1.B/test_9_is_valid_shot.py
with
5 additions
and
7 deletions
+5
-7
tests/1.B/test_9_is_valid_shot.py
View file @
e47eea05
...
@@ -2,19 +2,17 @@ import pytest
...
@@ -2,19 +2,17 @@ import pytest
from
src.harder_computer
import
is_valid_shot
from
src.harder_computer
import
is_valid_shot
from
tests.helpers.naming
import
apply_names
from
tests.helpers.naming
import
apply_names
@
pytest
.
mark
.
parametrize
(
'input1, input2, expected'
,
apply_names
(
'is_valid_shot'
,
[
True
,
True
,
False
],
[
@
pytest
.
mark
.
parametrize
(
'input1, input2, expected'
,
apply_names
(
'is_valid_shot'
,
[
True
,
True
,
False
],
[
((
0
,
0
),
[],
True
),
((
0
,
0
),
[],
True
),
((
-
1
,
0
),
[],
False
),
((
-
1
,
0
),
[],
False
),
((
8
,
0
),
[],
False
),
((
8
,
0
),
[],
False
),
((
0
,
-
1
),
[],
False
),
((
0
,
-
1
),
[],
False
),
((
0
,
8
),
[],
False
),
((
0
,
8
),
[],
False
),
((
0
,
0
),
[(
0
,
0
)],
False
),
((
0
,
0
),
[(
0
,
0
)],
False
),
((
2
,
5
),
[(
0
,
0
),
(
1
,
1
),
(
2
,
5
),
(
3
,
7
)],
False
),
((
2
,
5
),
[(
0
,
0
),
(
1
,
1
),
(
2
,
5
),
(
3
,
7
)],
False
),
((
2
,
5
),
[(
0
,
0
),
(
1
,
1
),
(
3
,
7
)],
True
),
((
2
,
5
),
[(
0
,
0
),
(
1
,
1
),
(
3
,
7
)],
True
),
]))
]))
def
test_is_valid_shot
(
input1
,
input2
,
expected
):
def
test_is_valid_shot
(
input1
,
input2
,
expected
):
result
=
is_valid_shot
(
input1
,
input2
)
result
=
is_valid_shot
(
input1
,
input2
)
assert
expected
==
result
,
(
f
"On an 8x8 board, the following inputs to the is_valid_shot "
assert
expected
==
result
,
f
"shot=
{
input1
}
, processed_shots=
{
input2
}
should lead to
{
expected
}
"
f
"function:
\n
{
input1
}
,
{
input2
}
\n
lead to the following output:"
f
"
\n
{
result
}
\n
when we expect:
\n
{
expected
}
."
)
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