Skip to content

Commit

Permalink
bring back tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewilyas committed Jan 23, 2022
1 parent f7e2e47 commit 405c096
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/test_image_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def create_and_validate(length, mode='raw', reversed=False):

with NamedTemporaryFile() as handle:
name = handle.name
print(name)

fields = {
'index': IntField(),
Expand Down Expand Up @@ -69,9 +68,7 @@ def create_and_validate(length, mode='raw', reversed=False):
if mode == 'raw':
assert_that(ch.all((image == (i % 255)).reshape(-1))).is_true()
else:
print('Here')
assert_that(ch.all((image == (i % 255)).reshape(-1))).is_true()
print('Here 2', ch.all((image == (i % 255)).reshape(-1)))

def make_and_read_cifar_subset(length):
my_dataset = Subset(CIFAR10(root='/tmp', train=True, download=True), range(length))
Expand All @@ -93,14 +90,14 @@ def make_and_read_cifar_subset(length):
for index, images in loader:
pass

# def test_cifar_subset():
# make_and_read_cifar_subset(200)
def test_cifar_subset():
make_and_read_cifar_subset(200)

# def test_simple_raw_image_pipeline():
# create_and_validate(500, 'raw', False)
def test_simple_raw_image_pipeline():
create_and_validate(500, 'raw', False)

# def test_simple_raw_image_pipeline_rev():
# create_and_validate(500, 'raw', True)
def test_simple_raw_image_pipeline_rev():
create_and_validate(500, 'raw', True)

def test_simple_jpg_image_pipeline():
create_and_validate(500, 'jpg', False)
Expand Down

0 comments on commit 405c096

Please sign in to comment.