File utils refactor and unittests

Create unit test for file utils
closes #25
closes #26
This commit is contained in:
Marc-Antoine Lafreniere
2019-02-11 22:45:41 -05:00
parent 8ca056fcdb
commit 453a3f7c08
8 changed files with 5804 additions and 42 deletions

View File

@@ -1,7 +1,6 @@
from pcbdevice.utils.path import path
from pcbdevice.utils.pbmformator import formatPbm
from pcbdevice.utils.plotimg import plotPath
from pcbdevice.utils.savetofile import matrixToFile
from pcbdevice.utils.FileUtils import FileUtils
if __name__ == "__main__":
# Usage example
@@ -10,9 +9,6 @@ if __name__ == "__main__":
resourcesFormattedPath = 'tests/resources/formatted/'
resourcesPathOutput = 'resources/pathoutput/'
matrixToFile(formatPbm(resourcesRawPath + 'test1ascii.pbm'), resourcesFormattedPath + 'test1.csv')
plotPath(path(formatPbm(resourcesRawPath + 'test100x100.pbm'), 5))
FileUtils.saveMatrixToFile(FileUtils.pbmToCsv(resourcesRawPath + 'test1ascii.pbm'), resourcesFormattedPath + 'test1.csv')
plotPath(path(FileUtils.pbmToCsv((resourcesRawPath + 'test100x100.pbm'), 5)))