From 52c6d4928a1b5fc65b95cf5b0784a560cec2ca1d Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Sat, 16 Jul 2016 15:49:48 +0800 Subject: Fix most broken tests so that I can safely merge into changes with known expected test result --- gerber/tests/test_cam.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gerber/tests/test_cam.py') diff --git a/gerber/tests/test_cam.py b/gerber/tests/test_cam.py index 00a8285..3ae0a24 100644 --- a/gerber/tests/test_cam.py +++ b/gerber/tests/test_cam.py @@ -113,10 +113,19 @@ def test_zeros(): def test_filesettings_validation(): """ Test FileSettings constructor argument validation """ + + # absolute-ish is not a valid notation assert_raises(ValueError, FileSettings, 'absolute-ish', 'inch', None, (2, 5), None) + + # degrees kelvin isn't a valid unit for a CAM file assert_raises(ValueError, FileSettings, 'absolute', 'degrees kelvin', None, (2, 5), None) + assert_raises(ValueError, FileSettings, 'absolute', 'inch', 'leading', (2, 5), 'leading') - assert_raises(ValueError, FileSettings, 'absolute', 'inch', 'following', (2, 5), None) + + # Technnically this should be an error, but Eangle files often do this incorrectly so we + # allow it + # assert_raises(ValueError, FileSettings, 'absolute', 'inch', 'following', (2, 5), None) + assert_raises(ValueError, FileSettings, 'absolute', 'inch', None, (2, 5), 'following') assert_raises(ValueError, FileSettings, 'absolute', 'inch', None, (2, 5, 6), None) -- cgit From 8cd842a41a55ab3d8f558a2e3e198beba7da58a1 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Thu, 21 Jan 2016 03:57:44 -0500 Subject: Manually mere rendering changes --- gerber/tests/test_cam.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'gerber/tests/test_cam.py') diff --git a/gerber/tests/test_cam.py b/gerber/tests/test_cam.py index 3ae0a24..24f2b9b 100644 --- a/gerber/tests/test_cam.py +++ b/gerber/tests/test_cam.py @@ -54,17 +54,20 @@ def test_filesettings_dict_assign(): assert_equal(fs.zero_suppression, 'leading') assert_equal(fs.format, (1, 2)) + def test_camfile_init(): """ Smoke test CamFile test """ cf = CamFile() + def test_camfile_settings(): """ Test CamFile Default Settings """ cf = CamFile() assert_equal(cf.settings, FileSettings()) + def test_bounds_override_smoketest(): cf = CamFile() cf.bounds @@ -89,7 +92,7 @@ def test_zeros(): assert_equal(fs.zeros, 'trailing') assert_equal(fs.zero_suppression, 'leading') - fs.zeros= 'leading' + fs.zeros = 'leading' assert_equal(fs.zeros, 'leading') assert_equal(fs.zero_suppression, 'trailing') @@ -113,21 +116,27 @@ def test_zeros(): def test_filesettings_validation(): """ Test FileSettings constructor argument validation """ - # absolute-ish is not a valid notation - assert_raises(ValueError, FileSettings, 'absolute-ish', 'inch', None, (2, 5), None) + assert_raises(ValueError, FileSettings, 'absolute-ish', + 'inch', None, (2, 5), None) # degrees kelvin isn't a valid unit for a CAM file - assert_raises(ValueError, FileSettings, 'absolute', 'degrees kelvin', None, (2, 5), None) + assert_raises(ValueError, FileSettings, 'absolute', + 'degrees kelvin', None, (2, 5), None) - assert_raises(ValueError, FileSettings, 'absolute', 'inch', 'leading', (2, 5), 'leading') + assert_raises(ValueError, FileSettings, 'absolute', + 'inch', 'leading', (2, 5), 'leading') # Technnically this should be an error, but Eangle files often do this incorrectly so we # allow it - # assert_raises(ValueError, FileSettings, 'absolute', 'inch', 'following', (2, 5), None) + #assert_raises(ValueError, FileSettings, 'absolute', + # 'inch', 'following', (2, 5), None) - assert_raises(ValueError, FileSettings, 'absolute', 'inch', None, (2, 5), 'following') - assert_raises(ValueError, FileSettings, 'absolute', 'inch', None, (2, 5, 6), None) + assert_raises(ValueError, FileSettings, 'absolute', + 'inch', None, (2, 5), 'following') + assert_raises(ValueError, FileSettings, 'absolute', + 'inch', None, (2, 5, 6), None) + def test_key_validation(): fs = FileSettings() @@ -138,5 +147,3 @@ def test_key_validation(): assert_raises(ValueError, fs.__setitem__, 'zero_suppression', 'following') assert_raises(ValueError, fs.__setitem__, 'zeros', 'following') assert_raises(ValueError, fs.__setitem__, 'format', (2, 5, 6)) - - -- cgit From 5af19af190c1fb0f0c5be029d46d63e657dde4d9 Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Thu, 21 Jan 2016 03:57:44 -0500 Subject: Commit partial merge so I can work on the plane --- gerber/tests/test_cam.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gerber/tests/test_cam.py') diff --git a/gerber/tests/test_cam.py b/gerber/tests/test_cam.py index 24f2b9b..a557e8c 100644 --- a/gerber/tests/test_cam.py +++ b/gerber/tests/test_cam.py @@ -116,6 +116,7 @@ def test_zeros(): def test_filesettings_validation(): """ Test FileSettings constructor argument validation """ +<<<<<<< HEAD # absolute-ish is not a valid notation assert_raises(ValueError, FileSettings, 'absolute-ish', 'inch', None, (2, 5), None) @@ -132,6 +133,16 @@ def test_filesettings_validation(): #assert_raises(ValueError, FileSettings, 'absolute', # 'inch', 'following', (2, 5), None) +======= + assert_raises(ValueError, FileSettings, 'absolute-ish', + 'inch', None, (2, 5), None) + assert_raises(ValueError, FileSettings, 'absolute', + 'degrees kelvin', None, (2, 5), None) + assert_raises(ValueError, FileSettings, 'absolute', + 'inch', 'leading', (2, 5), 'leading') + assert_raises(ValueError, FileSettings, 'absolute', + 'inch', 'following', (2, 5), None) +>>>>>>> 5476da8... Fix a bunch of rendering bugs. assert_raises(ValueError, FileSettings, 'absolute', 'inch', None, (2, 5), 'following') assert_raises(ValueError, FileSettings, 'absolute', -- cgit From 724c2b3bced319ed0b50c4302fed9b0e1aa9ce9c Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Sat, 5 Nov 2016 20:56:47 -0400 Subject: Finish Merge, most tests passing --- gerber/tests/test_cam.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'gerber/tests/test_cam.py') diff --git a/gerber/tests/test_cam.py b/gerber/tests/test_cam.py index a557e8c..ba5e99d 100644 --- a/gerber/tests/test_cam.py +++ b/gerber/tests/test_cam.py @@ -116,33 +116,22 @@ def test_zeros(): def test_filesettings_validation(): """ Test FileSettings constructor argument validation """ -<<<<<<< HEAD # absolute-ish is not a valid notation assert_raises(ValueError, FileSettings, 'absolute-ish', 'inch', None, (2, 5), None) - + # degrees kelvin isn't a valid unit for a CAM file assert_raises(ValueError, FileSettings, 'absolute', 'degrees kelvin', None, (2, 5), None) - + assert_raises(ValueError, FileSettings, 'absolute', 'inch', 'leading', (2, 5), 'leading') - + # Technnically this should be an error, but Eangle files often do this incorrectly so we # allow it #assert_raises(ValueError, FileSettings, 'absolute', # 'inch', 'following', (2, 5), None) - -======= - assert_raises(ValueError, FileSettings, 'absolute-ish', - 'inch', None, (2, 5), None) - assert_raises(ValueError, FileSettings, 'absolute', - 'degrees kelvin', None, (2, 5), None) - assert_raises(ValueError, FileSettings, 'absolute', - 'inch', 'leading', (2, 5), 'leading') - assert_raises(ValueError, FileSettings, 'absolute', - 'inch', 'following', (2, 5), None) ->>>>>>> 5476da8... Fix a bunch of rendering bugs. + assert_raises(ValueError, FileSettings, 'absolute', 'inch', None, (2, 5), 'following') assert_raises(ValueError, FileSettings, 'absolute', -- cgit