-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from ressy/release-0.0.8
Release 0.0.8
- Loading branch information
Showing
4 changed files
with
40 additions
and
2 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
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,26 @@ | ||
""" | ||
Test util functions. | ||
""" | ||
|
||
import unittest | ||
from vquest import util | ||
|
||
class TestChunker(unittest.TestCase): | ||
"""Basic test of iterator chunker.""" | ||
|
||
def test_chunker(self): | ||
"""Test that chunker breaks iterator items into fixed-size chunks.""" | ||
chunks = [] | ||
for chunk in util.chunker(range(8), 5): | ||
chunks.append(chunk) | ||
self.assertEqual([[0, 1, 2, 3, 4], [5, 6, 7]], chunks) | ||
|
||
class TestChunkerPerfectFit(unittest.TestCase): | ||
"""Test chunker for a perfect fit, with number of items equal to chunk size.""" | ||
|
||
def test_chunker(self): | ||
"""Test that chunker gives only one chunk for the perfect-fit case.""" | ||
chunks = [] | ||
for chunk in util.chunker(range(5), 5): | ||
chunks.append(chunk) | ||
self.assertEqual([[0, 1, 2, 3, 4]], chunks) |
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
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
See https://www.python.org/dev/peps/pep-0396/ | ||
""" | ||
|
||
__version__ = "0.0.7" | ||
__version__ = "0.0.8" |