Skip to content

Commit

Permalink
created test for TFRecord examples counting function, including examp…
Browse files Browse the repository at this point in the history
…le TFRecord file

#143
  • Loading branch information
monocongo committed Feb 7, 2020
1 parent fa1eead commit 1d08f96
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,20 @@ def test_count_labels(
assert label_counts["1"] == 2
assert label_counts["2"] == 1
assert label_counts["3"] == 1


# ------------------------------------------------------------------------------
@pytest.mark.usefixtures(
"data_dir",
)
def test_count_tfrecord_examples(
data_dir,
):
"""
Test for the cvdata.analyze.count_tfrecord_examples() function
:param data_dir: temporary directory into which test files will be loaded
"""
tfrecord_dir = os.path.join(str(data_dir), "tfrecord")
example_count = analyze.count_tfrecord_examples(tfrecord_dir)
assert example_count == 100
Binary file not shown.

0 comments on commit 1d08f96

Please sign in to comment.