Example #1
0
def test_img_to_cat():
    cat = "1"
    img = os.path.join(exp.STIM_DIR, "fruit-{}-2.png".format(cat))
    img_cat = exp.img_to_cat(img)
    assert_equal(cat, img_cat)
Example #2
0
def test_check():
    for label, cats in exp.EXPERIMENT_KEY.iteritems():
        for img in exp.ALL_IMGS:
            actual = exp.img_to_cat(img) in cats
            check = exp.check_pair(label, img)
            assert_equal(actual, check)