From 8d5e782ccf220d77f0aad5a4e5605dc5cbe0f410 Mon Sep 17 00:00:00 2001 From: Garret Fick Date: Sat, 6 Aug 2016 09:51:58 +0800 Subject: Fix multiple problems with the merge. There are still errors, but I will intentionally leave them because future merges might resolve them --- gerber/tests/golden/example_single_quadrant.gbr | 16 ++++++++++++++++ gerber/tests/test_cairo_backend.py | 6 ++++-- gerber/tests/test_primitives.py | 4 +--- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 gerber/tests/golden/example_single_quadrant.gbr (limited to 'gerber/tests') diff --git a/gerber/tests/golden/example_single_quadrant.gbr b/gerber/tests/golden/example_single_quadrant.gbr new file mode 100644 index 0000000..b0a3166 --- /dev/null +++ b/gerber/tests/golden/example_single_quadrant.gbr @@ -0,0 +1,16 @@ +%FSLAX23Y23*% +%MOIN*% +%ADD10C,0.01*% +G74* +D10* +%LPD*% +G01X1100Y600D02* +G03X700Y1000I-400J0D01* +G03X300Y600I0J-400D01* +G03X700Y200I400J0D01* +G03X1100Y600I0J400D01* +G01X300D02* +X1100D01* +X700Y200D02* +Y1000D01* +M02* diff --git a/gerber/tests/test_cairo_backend.py b/gerber/tests/test_cairo_backend.py index f358235..625a23e 100644 --- a/gerber/tests/test_cairo_backend.py +++ b/gerber/tests/test_cairo_backend.py @@ -182,6 +182,8 @@ def _test_render(gerber_path, png_expected_path, create_output_path = None): with open(png_expected_path, 'rb') as expected_file: expected_bytes = expected_file.read() - assert_equal(expected_bytes, actual_bytes) - + # Don't directly use assert_equal otherwise any failure pollutes the test results + equal = (expected_bytes == actual_bytes) + assert_true(equal) + return gerber diff --git a/gerber/tests/test_primitives.py b/gerber/tests/test_primitives.py index 261e6ef..e23d5f4 100644 --- a/gerber/tests/test_primitives.py +++ b/gerber/tests/test_primitives.py @@ -10,15 +10,13 @@ from .tests import * def test_primitive_smoketest(): p = Primitive() -<<<<<<< HEAD try: p.bounding_box assert_false(True, 'should have thrown the exception') except NotImplementedError: pass -======= #assert_raises(NotImplementedError, p.bounding_box) ->>>>>>> 5476da8... Fix a bunch of rendering bugs. + p.to_metric() p.to_inch() try: -- cgit