Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fastkml
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
fastkml
Commits
0b7da068
Commit
0b7da068
authored
Jul 07, 2015
by
Christian Ledermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
increase codequality and testcoverage
parent
2c9bffff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
fastkml/test_main.py
fastkml/test_main.py
+36
-2
setup.py
setup.py
+1
-1
No files found.
fastkml/test_main.py
View file @
0b7da068
...
...
@@ -133,9 +133,9 @@ class BuildKmlTestCase(unittest.TestCase):
'<kml xmlns="http://www.opengis.net/kml/2.2"/>'
[:
43
])
else
:
if
hasattr
(
etree
,
'register_namespace'
):
self
.
assertEqual
(
str
(
k
.
to_string
())[:
51
],
'<kml:kml xmlns:kml="http://www.opengis.net/kml/2.2" />'
[:
51
])
self
.
assertEqual
(
str
(
k
.
to_string
())[:
51
],
'<kml:kml xmlns:kml="http://www.opengis.net/kml/2.2" />'
[:
51
])
else
:
self
.
assertEqual
(
str
(
k
.
to_string
())[:
51
],
'<ns0:kml xmlns:ns0="http://www.opengis.net/kml/2.2" />'
[:
51
])
self
.
assertEqual
(
str
(
k
.
to_string
())[:
51
],
'<ns0:kml xmlns:ns0="http://www.opengis.net/kml/2.2" />'
[:
51
])
k2
=
kml
.
KML
()
k2
.
from_string
(
k
.
to_string
())
...
...
@@ -360,6 +360,7 @@ class BuildKmlTestCase(unittest.TestCase):
class
KmlFromStringTestCase
(
unittest
.
TestCase
):
def
test_document
(
self
):
doc
=
"""<kml xmlns="http://www.opengis.net/kml/2.2">
<Document targetId="someTargetId">
...
...
@@ -925,6 +926,12 @@ class KmlFromStringTestCase(unittest.TestCase):
doc2
.
from_string
(
doc
.
to_string
())
self
.
assertEqual
(
doc
.
to_string
(),
doc2
.
to_string
())
def
test_linarring_placemark
(
self
):
doc
=
"""<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<kml:coordinates>0.0,0.0 1.0,0.0 1.0,1.0 0.0,0.0</kml:coordinates>
</Placemark> </kml>"""
class
StyleTestCase
(
unittest
.
TestCase
):
...
...
@@ -1076,6 +1083,33 @@ class StyleFromStringTestCase(unittest.TestCase):
k2
.
from_string
(
k
.
to_string
())
self
.
assertEqual
(
k2
.
to_string
(),
k
.
to_string
())
def
test_balloonstyle_old_color
(
self
):
doc
=
"""<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Document.kml</name>
<Style id="exampleBalloonStyle">
<BalloonStyle>
<!-- a background color for the balloon -->
<color>ffffffbb</color>
</BalloonStyle>
</Style>
</Document>
</kml>"""
k
=
kml
.
KML
()
k
.
from_string
(
doc
)
self
.
assertEqual
(
len
(
list
(
k
.
features
())),
1
)
self
.
assertTrue
(
isinstance
(
list
(
list
(
k
.
features
())[
0
].
styles
())[
0
],
styles
.
Style
))
style
=
list
(
list
(
list
(
k
.
features
())[
0
].
styles
())[
0
].
styles
())[
0
]
self
.
assertTrue
(
isinstance
(
style
,
styles
.
BalloonStyle
))
self
.
assertEqual
(
style
.
bgColor
,
'ffffffbb'
)
k2
=
kml
.
KML
()
k2
.
from_string
(
k
.
to_string
())
self
.
assertEqual
(
k2
.
to_string
(),
k
.
to_string
())
def
test_labelstyle
(
self
):
doc
=
"""<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
...
...
setup.py
View file @
0b7da068
...
...
@@ -49,7 +49,7 @@ setup(
include_package_data
=
True
,
zip_safe
=
False
,
tests_require
=
[
'pytest'
],
cmdclass
=
{
'test'
:
PyTest
},
cmdclass
=
{
'test'
:
PyTest
},
install_requires
=
[
# -*- Extra requirements: -*-
'pygeoif'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment