From 462bab50d3538dbd906533c50eb17a1183818946 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Lafreniere Date: Sat, 16 Feb 2019 20:50:37 -0500 Subject: [PATCH] Unit test of pixel dimension close #33 --- pcbdevice/tests/utils/test_fileUtils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcbdevice/tests/utils/test_fileUtils.py b/pcbdevice/tests/utils/test_fileUtils.py index 81f7d10..2ecffa6 100644 --- a/pcbdevice/tests/utils/test_fileUtils.py +++ b/pcbdevice/tests/utils/test_fileUtils.py @@ -16,3 +16,11 @@ class TestFileUtils(TestCase): FileUtils.saveMatrixToFile(actual, resources + 'output/test1.csv') expected = TestUtils.readIntFile(resources + 'output/test1.csv') assert actual == expected + + def test_getPixelSize(self): + assert 10, 10 == FileUtils.getPixelSize(10, 10, 100, 100) + assert 1, 1 == FileUtils.getPixelSize(100, 100, 100, 100) + assert 10, 10 == FileUtils.getPixelSize(10, 10, 10, 10, unit = 'cm') + assert 10, 10 == FileUtils.getPixelSize(10, 10, 1, 1, unit = 'm') + assert 254, 254 == FileUtils.getPixelSize(10, 10, 10, 10, unit = 'in') + assert 10, 5 == FileUtils.getPixelSize(10, 10, 10, 20) \ No newline at end of file