-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7fb2a80
commit adad87a
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from vision_agent.agent.vision_agent import sample_n_evenly_spaced | ||
|
||
|
||
def test_sample_n_evenly_spaced_side_cases(): | ||
# Test for empty input | ||
assert sample_n_evenly_spaced([], 0) == [] | ||
assert sample_n_evenly_spaced([], 1) == [] | ||
|
||
# Test for n = 0 | ||
assert sample_n_evenly_spaced([1, 2, 3, 4], 0) == [] | ||
|
||
# Test for n = 1 | ||
assert sample_n_evenly_spaced([1, 2, 3, 4], -1) == [] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4], 5) == [1, 2, 3, 4] | ||
|
||
|
||
def test_sample_n_evenly_spaced_even_cases(): | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6], 2) == [1, 4] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6], 3) == [1, 3, 5] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6], 4) == [1, 2, 3, 4] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6], 5) == [1, 2, 3, 4, 5] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6], 6) == [1, 2, 3, 4, 5, 6] | ||
|
||
|
||
def test_sample_n_evenly_spaced_odd_cases(): | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6, 7], 2) == [1, 5] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6, 7], 3) == [1, 4, 7] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6, 7], 4) == [1, 3, 5, 7] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6, 7], 5) == [1, 2, 3, 5, 7] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6, 7], 6) == [1, 2, 3, 4, 5, 7] | ||
assert sample_n_evenly_spaced([1, 2, 3, 4, 5, 6, 7], 7) == [1, 2, 3, 4, 5, 6, 7] |