Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit test for utils.py #668

Merged
merged 4 commits into from
Mar 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion hub/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

from hub.utils import *
from hub.utils import _flatten
from hub.utils import _flatten, _tuple_product


def test_flatten_array():
Expand Down Expand Up @@ -79,3 +79,9 @@ def test_batchify():
actual = iter(batchify([1, 2, 3, 4], 2))
assert next(actual) == [1, 2]
assert next(actual) == [3, 4]


def test_tuple_product():
expected_result = 24
result = _tuple_product(tuple((1, 2, 3, 4)))
assert result == expected_result