Files
S4-P3-Projet/pcbdevice/tests/utils/test_fileUtils.py
Marc-Antoine Lafreniere ff7a860c2d Get pixel dimensions
Add args to input width and height of the image
2019-02-16 20:16:47 -05:00

19 lines
641 B
Python

from unittest import TestCase
from pcbdevice.utils import TestUtils
from pcbdevice.utils.FileUtils import FileUtils
resources = './pcbdevice/tests/resources/'
class TestFileUtils(TestCase):
def test_pbmToCsv(self):
actual = FileUtils.pbmToMatrix(resources + 'raw/test1.pbm')
expected = TestUtils.readIntFile(resources + 'formatted/test1.csv')
assert actual == expected
def test_saveMatrixToFile(self):
actual = FileUtils.pbmToMatrix(resources + 'raw/test1.pbm')
FileUtils.saveMatrixToFile(actual, resources + 'output/test1.csv')
expected = TestUtils.readIntFile(resources + 'output/test1.csv')
assert actual == expected