mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
state: test: refactor existing state test to pytest
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import pytest
|
||||
|
||||
from dvc.utils import chunk
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"list_to_chunk, chunk_size, expected_chunks",
|
||||
[
|
||||
([1, 2, 3, 4], 1, [[1], [2], [3], [4]]),
|
||||
([1, 2, 3, 4], 2, [[1, 2], [3, 4]]),
|
||||
([1, 2, 3, 4], 3, [[1, 2, 3], [4]]),
|
||||
],
|
||||
)
|
||||
def test_chunk(list_to_chunk, chunk_size, expected_chunks):
|
||||
result = list(chunk(list_to_chunk, chunk_size))
|
||||
assert result == expected_chunks
|
||||
Reference in New Issue
Block a user