Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jreiberkyle
Copy link

This PR adds tests for BaseGeometry._repr_svg_() in preparation for changes to the function in #1295.

@jreiberkyle
Copy link
Author

@sgillies I prepared this PR so we can get some tests in before changing the SVG functionality.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1813929098

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 81.113%

Totals Coverage Status
Change from base Build 1806130939: 0.0%
Covered Lines: 2070
Relevant Lines: 2552

💛 - Coveralls

import xml.etree.ElementTree as ET

from . import unittest
from shapely.geometry import Point, MultiPoint, LineString, MultiLineString,\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: black would eliminate the forward slash and turn these into a list.

'width="100.0" height="100.0" '
'viewBox="2.88 3.88 3.24 3.24" preserveAspectRatio="xMinYMin meet">'
'<g transform="matrix(1,0,0,-1,0,11.0)"><g>'
'<circle cx="6.0" cy="7.0" r="0.09720000000000001" '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I see something like that r value, I worry that it will be platform dependent. On a different system it might be "0.09720000000000002".

The most important thing might be to check that we have two circle elements and that their radii are roughly correct?

Copy link
Contributor

@sgillies sgillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jreiberkyle these tests will help a lot! My only concern is that asserting on string representations of floats could be a bit flaky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants