Commit graph

46 commits

Author SHA1 Message Date
Eduard Braun
d8b6a027b8 Adjust unittests for previous commit 2017-05-17 03:46:56 +02:00
Eduard Braun
f1827735a7 Adjust a unittest
(latest optimizations already paid off ;-) )
2017-05-17 02:51:10 +02:00
Eduard Braun
98e3040645 Add unittest for --set-c-precision (7cb0d36d72) 2017-02-25 19:44:18 +01:00
Eduard Braun
090884a70f Don't force whitespace for elliptical paths (fixes #89)
This was only required in an early draft of the SVG spec (an error that was corrected later, see [1,2])

[1] https://github.com/scour-project/scour/issues/89#issuecomment-244216600
[2] https://github.com/scour-project/scour/issues/89#issuecomment-244337118
2017-02-25 19:44:18 +01:00
Eduard Braun
ffeb76c894 Unittests: remove temporary file 'testscour_temp.svg' after running tests 2017-02-22 22:13:04 +01:00
Eduard Braun
f7d6406d38 Work around https://github.com/travis-ci/travis-ci/issues/3080 as pypy throws if 'ping' can't be executed 2017-02-22 22:07:17 +01:00
Eduard Braun
0ffefcd8bb Unittests for --enable-viewboxing 2017-02-19 16:10:01 +01:00
Eduard Braun
f5a61eeeb3 Even better fix for 8f87118725
(previous solution still did not work for numbers like 123.4 with precision < 3)
2017-02-19 00:57:00 +01:00
Eduard Braun
a69efb3a55 Add unittests for b00b374e64 and 8f87118725 2017-02-18 19:36:19 +01:00
Eduard Braun
6cf8c2b7d9 call sanitizeOptions() in start() to prevent a third-party breakage 2016-11-27 18:52:39 +01:00
Eduard Braun
de1441fd58 Exclude (system specific) absolute paths from test file and add a unittest that creates/tests absolute paths on-the-fly 2016-09-23 23:16:19 +02:00
Eduard Braun
902e112a96 Add unittests for embedding rasters (and --disable-embed-rasters) 2016-09-23 23:14:56 +02:00
Eduard Braun
45a2869a17 Add unittests for --protect-ids-_ options 2016-09-18 18:29:13 +02:00
Eduard Braun
829b630d64 Add unittests which emulate calling the scour module from command line 2016-09-18 17:13:00 +02:00
Eduard Braun
47cfb9aa0e Add unittest for --strip-xml-space 2016-09-18 17:13:00 +02:00
Eduard Braun
d9198d7872 Order imports as suggested by PEP 8 2016-09-15 21:56:36 +02:00
Eduard Braun
99363c9089 Fix all issues detected by pyflakes 2016-09-15 21:31:34 +02:00
Eduard Braun
82df0d2327 More PEP 8 cleanup
(solves all issues reported by `pycodestyle`)
2016-09-15 21:02:15 +02:00
Eduard Braun
fc356815a2 Some reformatting and manually break all long lines at column 119 2016-09-15 01:54:19 +02:00
Eduard Braun
0f1974c1e2 Consistent whitespace across source files according to PEP 8
(mostly automated by using autopep8, fixes #69)
2016-09-15 00:35:13 +02:00
Eduard Braun
082b579410 We don't want spaces in the serialized value of style attributes.
Add a unittest that should catch this and other issues with parsing/serializing the `style` attribute
2016-09-11 14:01:04 +02:00
Eduard Braun
10e687b887 Add unittests for 1cde426009 and 641d2db08a392e4a7df20c700e1accb9cd8d1341 2016-09-11 00:16:17 +02:00
Eduard Braun
1aa5722c6a Fix conversion of cubic Bézier "curveto" commands into "shorthand/smooth curveto" commands. (#110)
When the preceeding path segment is a Bézier curve, too, the first control point of the shorthand defaults to the mirrored version of the second control point of this preceeding path segment. Scour always assumed (0,0) as the control point in this case which could result in modified path data (e.g. #91).
2016-09-06 01:43:36 +02:00
Eduard Braun
ec855211de Fix replacement of duplicate gradients if "fill/stroke" contains fallbacks (#109)
(fixes #79)
2016-09-05 22:44:55 +02:00
Eduard Braun
0c63344ea4 Add a check to prevent we make path data longer by "optimization" 2016-08-31 07:06:42 +02:00
Eduard Braun
21e6c7491b Fix a unittest that failed due to the increased accuracy of paths after 29e005bf7b 2016-08-31 06:32:05 +02:00
Eitot
aa48c90d56 Add options to remove descriptive elements (#102)
* --remove-titles (removes <title>)
* --remove-descriptions (removes <desc>)
* --remove-descriptive-elements (removes <title>, <desc> and <metadata>)
2016-08-29 21:05:12 +02:00
Eduard Braun
842123a393 Fix improper comparison of numeric default attribute values with textvalues resulting in wrongly removed attributes (#101)
For example for `orient="auto"` SVGLength() returns (value=0, units=Unit.INVALID); since the default value for `orient` is zero it was removed as there was check for a valid unit.
2016-08-29 06:37:28 +02:00
Eduard Braun
5844076258 Only attempt to group elements that the content model allows to be children of a <g> when --create-groups is specified. (#98)
(before it could happen that e.g. `tspan` elements were grouped, which is invalid; fixes issues #96 and #97)
2016-08-29 02:33:13 +02:00
Eduard Braun
cbda5dcd86 Add unittests for #66 2016-08-26 23:45:44 +02:00
Eduard Braun
386d5d8656 Allow elements to be found via Document.getElementById() in the minidom document returned by scourXmlFile() (#68) 2016-08-25 21:13:09 +02:00
Eduard Braun
4f23ea7a34 Print usage information if no input file was specified (and no data is available from stdin) (#65)
fixes #34
2016-08-23 21:16:14 +02:00
Eduard Braun
57f93efc89 Don't escape quotes ('/") in text nodes and attributes. (#64)
- In text nodes quotes are fine
- In attributes quotes are fine if used reciprocally.

Escaping in the latter case often causes issues, e.g. with quoted font names (#21) or inline CSS styles (#56), while it probably does not gain anything (if quotes are wrongly used in attribute names the XML is most likely invalid to start with)
2016-08-16 00:10:41 +02:00
Eduard Braun
fe2884c3e8 Don't remove unreferenced defs if --keep-unreferenced-defs is specified (#62)
* Don't remove unreferenced defs if `--keep-unreferenced-defs` is specified
(fixes #18)

* Add unittests for previous commit
2016-08-14 18:52:55 +02:00
Eduard Braun
f83b03707b Fix unittests for previous commit 2016-06-12 15:42:30 +02:00
Tobias Oberstein
6a23a4cd71 add unit tests 2016-04-02 17:41:20 +02:00
Tobias Oberstein
d710fb3f6c whitespace 2016-04-02 17:40:40 +02:00
Eduard Braun
cf08a72e41 Unittests: Add two tests for and simplify after e701acdc25 2016-02-19 04:40:57 +01:00
Eduard Braun
946ca3ce4a Unittests: Add a test for proper decoding of ISO 8859-15 2015-12-09 21:32:18 +01:00
Eduard Braun
4eade69201 Open input file in binary mode an let XML parser deal with encoding.
Fixes #26
2015-12-08 23:38:06 +01:00
Eduard Braun
32e7e5517f Unittests: Account for b979fe19e5 (fix one test and add two more)
- Unused XML namespace declarations *are supposed* to be removed
- XML namespace declarations that are used as prefix for elements/attributes *must not* be removed
2015-12-07 00:33:08 +01:00
Eduard Braun
f0c69b827e Unittests: Sync options with current Scour
(fixes yet two other errors when running tests)
2015-12-06 23:07:06 +01:00
Eduard Braun
c54c5e5d7e Unittests: Fix warnings
- Replace deprecated assertion-aliases
- Make sure opened files are properly closed after usage
2015-12-06 22:13:21 +01:00
Eduard Braun
320bdda6e9 Unittests: Run python-modernize 2015-12-06 21:20:05 +01:00
Eduard Braun
391ff77659 Unittests: Fix import paths 2015-12-06 20:10:12 +01:00
Eduard Braun
3b7e8a0091 Restore unittests from history 2015-12-06 19:59:06 +01:00