Skip to content

Commit

Permalink
fix test relative location
Browse files Browse the repository at this point in the history
  • Loading branch information
leblancfg committed Sep 29, 2017
1 parent 685b97c commit 0294e72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_autocrop.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@

import cv2
import numpy as np
import os.path

from autocrop.autocrop import gamma, main, crop
import pytest

matrix = np.array([[1,2,3],[4,5,6],[7,8,9]])
noise = cv2.imread('data/noise.png')

def test_gamma_can_do_sqrt():
"""This function is so tightly coupled to cv2 it's probably useless.
Still might flag cv2 or numpy boo-boos."""
matrix = np.array([[1,2,3],[4,5,6],[7,8,9]])
expected = np.uint8([[15, 22, 27], [31, 35, 39], [42, 45, 47]])
np.testing.assert_array_equal(gamma(img=matrix, correction=0.5), expected)

def test_crop_noise_returns_none():
loc = 'tests/data/noise.png'
noise = cv2.imread(loc)
assert crop(noise) == None

0 comments on commit 0294e72

Please sign in to comment.