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
34d49707
Commit
34d49707
authored
Aug 07, 2012
by
Christian Ledermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make tests run with python3
parent
c1c8031f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
85 deletions
+85
-85
fastkml/tests.py
fastkml/tests.py
+85
-85
No files found.
fastkml/tests.py
View file @
34d49707
...
@@ -97,8 +97,8 @@ class BaseClassesTestCase(unittest.TestCase):
...
@@ -97,8 +97,8 @@ class BaseClassesTestCase(unittest.TestCase):
f
.
__name__
=
'Feature'
f
.
__name__
=
'Feature'
f
.
styleUrl
=
'#default'
f
.
styleUrl
=
'#default'
self
.
assertTrue
(
'Feature>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'Feature>'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'#default'
in
f
.
to_string
(
))
self
.
assertTrue
(
'#default'
in
str
(
f
.
to_string
()
))
def
test_Container
(
self
):
def
test_Container
(
self
):
...
@@ -129,11 +129,11 @@ class BuildKmlTestCase(unittest.TestCase):
...
@@ -129,11 +129,11 @@ class BuildKmlTestCase(unittest.TestCase):
k
=
kml
.
KML
()
k
=
kml
.
KML
()
self
.
assertEqual
(
len
(
list
(
k
.
features
())),
0
)
self
.
assertEqual
(
len
(
list
(
k
.
features
())),
0
)
if
hasattr
(
etree
,
'register_namespace'
):
if
hasattr
(
etree
,
'register_namespace'
):
self
.
assertEqual
(
k
.
to_string
(
),
self
.
assertEqual
(
str
(
k
.
to_string
()
),
'<kml:kml xmlns:kml="http://www.opengis.net/kml/2.2"/>'
)
'<kml:kml xmlns:kml="http://www.opengis.net/kml/2.2"
/>'
)
else
:
else
:
self
.
assertEqual
(
k
.
to_string
(
),
self
.
assertEqual
(
str
(
k
.
to_string
()
),
'<ns0:kml xmlns:ns0="http://www.opengis.net/kml/2.2"/>'
)
'<ns0:kml xmlns:ns0="http://www.opengis.net/kml/2.2"
/>'
)
k2
=
kml
.
KML
()
k2
=
kml
.
KML
()
k2
.
from_string
(
k
.
to_string
())
k2
.
from_string
(
k
.
to_string
())
self
.
assertEqual
(
k
.
to_string
(),
k2
.
to_string
())
self
.
assertEqual
(
k
.
to_string
(),
k2
.
to_string
())
...
@@ -200,13 +200,13 @@ class BuildKmlTestCase(unittest.TestCase):
...
@@ -200,13 +200,13 @@ class BuildKmlTestCase(unittest.TestCase):
k
=
kml
.
KML
()
k
=
kml
.
KML
()
d
=
kml
.
Document
()
d
=
kml
.
Document
()
d
.
author
=
'Christian Ledermann'
d
.
author
=
'Christian Ledermann'
self
.
assertTrue
(
'Christian Ledermann'
in
d
.
to_string
(
))
self
.
assertTrue
(
'Christian Ledermann'
in
str
(
d
.
to_string
()
))
a
=
atom
.
Author
(
name
=
'Nobody'
,
uri
=
'http://localhost'
,
email
=
'cl@donotreply.com'
)
a
=
atom
.
Author
(
name
=
'Nobody'
,
uri
=
'http://localhost'
,
email
=
'cl@donotreply.com'
)
d
.
author
=
a
d
.
author
=
a
self
.
assertFalse
(
'Christian Ledermann'
in
d
.
to_string
(
))
self
.
assertFalse
(
'Christian Ledermann'
in
str
(
d
.
to_string
()
))
self
.
assertTrue
(
'Nobody'
in
d
.
to_string
(
))
self
.
assertTrue
(
'Nobody'
in
str
(
d
.
to_string
()
))
self
.
assertTrue
(
'http://localhos
'
in
d
.
to_string
(
))
self
.
assertTrue
(
'http://localhos
t'
in
str
(
d
.
to_string
()
))
self
.
assertTrue
(
'cl@donotreply.com'
in
d
.
to_string
(
))
self
.
assertTrue
(
'cl@donotreply.com'
in
str
(
d
.
to_string
()
))
d2
=
kml
.
Document
()
d2
=
kml
.
Document
()
d2
.
from_string
(
d
.
to_string
())
d2
.
from_string
(
d
.
to_string
())
self
.
assertEqual
(
d
.
to_string
(),
d2
.
to_string
())
self
.
assertEqual
(
d
.
to_string
(),
d2
.
to_string
())
...
@@ -216,10 +216,10 @@ class BuildKmlTestCase(unittest.TestCase):
...
@@ -216,10 +216,10 @@ class BuildKmlTestCase(unittest.TestCase):
def
test_link
(
self
):
def
test_link
(
self
):
d
=
kml
.
Document
()
d
=
kml
.
Document
()
d
.
link
=
'http://localhost'
d
.
link
=
'http://localhost'
self
.
assertTrue
(
'http://localhost'
in
d
.
to_string
(
))
self
.
assertTrue
(
'http://localhost'
in
str
(
d
.
to_string
()
))
l
=
atom
.
Link
(
href
=
'#here'
)
l
=
atom
.
Link
(
href
=
'#here'
)
d
.
link
=
l
d
.
link
=
l
self
.
assertTrue
(
'#here'
in
d
.
to_string
(
))
self
.
assertTrue
(
'#here'
in
str
(
d
.
to_string
()
))
self
.
assertRaises
(
TypeError
,
d
.
link
,
object
)
self
.
assertRaises
(
TypeError
,
d
.
link
,
object
)
d2
=
kml
.
Document
()
d2
=
kml
.
Document
()
d2
.
from_string
(
d
.
to_string
())
d2
.
from_string
(
d
.
to_string
())
...
@@ -735,30 +735,30 @@ class DateTimeTestCase( unittest.TestCase ):
...
@@ -735,30 +735,30 @@ class DateTimeTestCase( unittest.TestCase ):
now
=
datetime
.
datetime
.
now
()
now
=
datetime
.
datetime
.
now
()
ts
=
kml
.
TimeStamp
(
timestamp
=
now
)
ts
=
kml
.
TimeStamp
(
timestamp
=
now
)
self
.
assertEqual
(
ts
.
timestamp
,
[
now
,
'dateTime'
])
self
.
assertEqual
(
ts
.
timestamp
,
[
now
,
'dateTime'
])
self
.
assertTrue
(
'TimeStamp>'
in
ts
.
to_string
(
))
self
.
assertTrue
(
'TimeStamp>'
in
str
(
ts
.
to_string
()
))
self
.
assertTrue
(
'when>'
in
ts
.
to_string
(
))
self
.
assertTrue
(
'when>'
in
str
(
ts
.
to_string
()
))
self
.
assertTrue
(
now
.
isoformat
()
in
ts
.
to_string
(
))
self
.
assertTrue
(
now
.
isoformat
()
in
str
(
ts
.
to_string
()
))
y2k
=
datetime
.
date
(
2000
,
1
,
1
)
y2k
=
datetime
.
date
(
2000
,
1
,
1
)
ts
=
kml
.
TimeStamp
(
timestamp
=
y2k
)
ts
=
kml
.
TimeStamp
(
timestamp
=
y2k
)
self
.
assertEqual
(
ts
.
timestamp
,
[
y2k
,
'date'
])
self
.
assertEqual
(
ts
.
timestamp
,
[
y2k
,
'date'
])
self
.
assertTrue
(
'2000-01-01'
in
ts
.
to_string
(
))
self
.
assertTrue
(
'2000-01-01'
in
str
(
ts
.
to_string
()
))
def
test_timestamp_resolution
(
self
):
def
test_timestamp_resolution
(
self
):
now
=
datetime
.
datetime
.
now
()
now
=
datetime
.
datetime
.
now
()
ts
=
kml
.
TimeStamp
(
timestamp
=
now
)
ts
=
kml
.
TimeStamp
(
timestamp
=
now
)
self
.
assertTrue
(
now
.
isoformat
()
in
ts
.
to_string
(
))
self
.
assertTrue
(
now
.
isoformat
()
in
str
(
ts
.
to_string
()
))
ts
.
timestamp
[
1
]
=
'date'
ts
.
timestamp
[
1
]
=
'date'
self
.
assertTrue
(
now
.
date
().
isoformat
()
in
ts
.
to_string
(
))
self
.
assertTrue
(
now
.
date
().
isoformat
()
in
str
(
ts
.
to_string
()
))
self
.
assertFalse
(
now
.
isoformat
()
in
ts
.
to_string
(
))
self
.
assertFalse
(
now
.
isoformat
()
in
str
(
ts
.
to_string
()
))
year
=
str
(
now
.
year
)
year
=
str
(
now
.
year
)
ym
=
now
.
strftime
(
'%Y-%m'
)
ym
=
now
.
strftime
(
'%Y-%m'
)
ts
.
timestamp
[
1
]
=
'gYearMonth'
ts
.
timestamp
[
1
]
=
'gYearMonth'
self
.
assertTrue
(
ym
in
ts
.
to_string
(
))
self
.
assertTrue
(
ym
in
str
(
ts
.
to_string
()
))
self
.
assertFalse
(
now
.
date
().
isoformat
()
in
ts
.
to_string
(
))
self
.
assertFalse
(
now
.
date
().
isoformat
()
in
str
(
ts
.
to_string
()
))
ts
.
timestamp
[
1
]
=
'gYear'
ts
.
timestamp
[
1
]
=
'gYear'
self
.
assertTrue
(
year
in
ts
.
to_string
(
))
self
.
assertTrue
(
year
in
str
(
ts
.
to_string
()
))
self
.
assertFalse
(
ym
in
ts
.
to_string
(
))
self
.
assertFalse
(
ym
in
str
(
ts
.
to_string
()
))
ts
.
timestamp
=
None
ts
.
timestamp
=
None
self
.
assertRaises
(
TypeError
,
ts
.
to_string
)
self
.
assertRaises
(
TypeError
,
ts
.
to_string
)
...
@@ -769,14 +769,14 @@ class DateTimeTestCase( unittest.TestCase ):
...
@@ -769,14 +769,14 @@ class DateTimeTestCase( unittest.TestCase ):
ts
=
kml
.
TimeSpan
(
end
=
now
,
begin
=
y2k
)
ts
=
kml
.
TimeSpan
(
end
=
now
,
begin
=
y2k
)
self
.
assertEqual
(
ts
.
end
,
[
now
,
'dateTime'
])
self
.
assertEqual
(
ts
.
end
,
[
now
,
'dateTime'
])
self
.
assertEqual
(
ts
.
begin
,
[
y2k
,
'dateTime'
])
self
.
assertEqual
(
ts
.
begin
,
[
y2k
,
'dateTime'
])
self
.
assertTrue
(
'TimeSpan>'
in
ts
.
to_string
(
))
self
.
assertTrue
(
'TimeSpan>'
in
str
(
ts
.
to_string
()
))
self
.
assertTrue
(
'begin>'
in
ts
.
to_string
(
))
self
.
assertTrue
(
'begin>'
in
str
(
ts
.
to_string
()
))
self
.
assertTrue
(
'end>'
in
ts
.
to_string
(
))
self
.
assertTrue
(
'end>'
in
str
(
ts
.
to_string
()
))
self
.
assertTrue
(
now
.
isoformat
()
in
ts
.
to_string
(
))
self
.
assertTrue
(
now
.
isoformat
()
in
str
(
ts
.
to_string
()
))
self
.
assertTrue
(
y2k
.
isoformat
()
in
ts
.
to_string
(
))
self
.
assertTrue
(
y2k
.
isoformat
()
in
str
(
ts
.
to_string
()
))
ts
.
end
=
None
ts
.
end
=
None
self
.
assertFalse
(
now
.
isoformat
()
in
ts
.
to_string
(
))
self
.
assertFalse
(
now
.
isoformat
()
in
str
(
ts
.
to_string
()
))
self
.
assertTrue
(
y2k
.
isoformat
()
in
ts
.
to_string
(
))
self
.
assertTrue
(
y2k
.
isoformat
()
in
str
(
ts
.
to_string
()
))
ts
.
begin
=
None
ts
.
begin
=
None
self
.
assertRaises
(
ValueError
,
ts
.
to_string
)
self
.
assertRaises
(
ValueError
,
ts
.
to_string
)
...
@@ -785,14 +785,14 @@ class DateTimeTestCase( unittest.TestCase ):
...
@@ -785,14 +785,14 @@ class DateTimeTestCase( unittest.TestCase ):
now
=
datetime
.
datetime
.
now
()
now
=
datetime
.
datetime
.
now
()
f
=
kml
.
Document
()
f
=
kml
.
Document
()
f
.
timeStamp
=
now
f
.
timeStamp
=
now
self
.
assertTrue
(
now
.
isoformat
()
in
f
.
to_string
(
))
self
.
assertTrue
(
now
.
isoformat
()
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'TimeStamp>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'TimeStamp>'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'when>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'when>'
in
str
(
f
.
to_string
()
))
f
.
timeStamp
=
now
.
date
()
f
.
timeStamp
=
now
.
date
()
self
.
assertTrue
(
now
.
date
().
isoformat
()
in
f
.
to_string
(
))
self
.
assertTrue
(
now
.
date
().
isoformat
()
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
now
.
isoformat
()
in
f
.
to_string
(
))
self
.
assertFalse
(
now
.
isoformat
()
in
str
(
f
.
to_string
()
))
f
.
timeStamp
=
None
f
.
timeStamp
=
None
self
.
assertFalse
(
'TimeStamp>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'TimeStamp>'
in
str
(
f
.
to_string
()
))
def
test_feature_timespan
(
self
):
def
test_feature_timespan
(
self
):
now
=
datetime
.
datetime
.
now
()
now
=
datetime
.
datetime
.
now
()
...
@@ -800,19 +800,19 @@ class DateTimeTestCase( unittest.TestCase ):
...
@@ -800,19 +800,19 @@ class DateTimeTestCase( unittest.TestCase ):
f
=
kml
.
Document
()
f
=
kml
.
Document
()
f
.
begin
=
y2k
f
.
begin
=
y2k
f
.
end
=
now
f
.
end
=
now
self
.
assertTrue
(
now
.
isoformat
()
in
f
.
to_string
(
))
self
.
assertTrue
(
now
.
isoformat
()
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'2000-01-01'
in
f
.
to_string
(
))
self
.
assertTrue
(
'2000-01-01'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'TimeSpan>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'TimeSpan>'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'begin>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'begin>'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'end>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'end>'
in
str
(
f
.
to_string
()
))
f
.
end
=
None
f
.
end
=
None
self
.
assertFalse
(
now
.
isoformat
()
in
f
.
to_string
(
))
self
.
assertFalse
(
now
.
isoformat
()
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'2000-01-01'
in
f
.
to_string
(
))
self
.
assertTrue
(
'2000-01-01'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'TimeSpan>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'TimeSpan>'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'begin>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'begin>'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'end>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'end>'
in
str
(
f
.
to_string
()
))
f
.
begin
=
None
f
.
begin
=
None
self
.
assertFalse
(
'TimeSpan>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'TimeSpan>'
in
str
(
f
.
to_string
()
))
def
test_feature_timespan_stamp
(
self
):
def
test_feature_timespan_stamp
(
self
):
now
=
datetime
.
datetime
.
now
()
now
=
datetime
.
datetime
.
now
()
...
@@ -820,31 +820,31 @@ class DateTimeTestCase( unittest.TestCase ):
...
@@ -820,31 +820,31 @@ class DateTimeTestCase( unittest.TestCase ):
f
=
kml
.
Document
()
f
=
kml
.
Document
()
f
.
begin
=
y2k
f
.
begin
=
y2k
f
.
end
=
now
f
.
end
=
now
self
.
assertTrue
(
now
.
isoformat
()
in
f
.
to_string
(
))
self
.
assertTrue
(
now
.
isoformat
()
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'2000-01-01'
in
f
.
to_string
(
))
self
.
assertTrue
(
'2000-01-01'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'TimeSpan>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'TimeSpan>'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'begin>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'begin>'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'end>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'end>'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'TimeStamp>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'TimeStamp>'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'when>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'when>'
in
str
(
f
.
to_string
()
))
# when we set a timestamp an existing timespan will be deleted
# when we set a timestamp an existing timespan will be deleted
f
.
timeStamp
=
now
f
.
timeStamp
=
now
self
.
assertTrue
(
now
.
isoformat
()
in
f
.
to_string
(
))
self
.
assertTrue
(
now
.
isoformat
()
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'TimeStamp>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'TimeStamp>'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'when>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'when>'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'2000-01-01'
in
f
.
to_string
(
))
self
.
assertFalse
(
'2000-01-01'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'TimeSpan>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'TimeSpan>'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'begin>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'begin>'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'end>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'end>'
in
str
(
f
.
to_string
()
))
# when we set a timespan an existing timestamp will be deleted
# when we set a timespan an existing timestamp will be deleted
f
.
end
=
y2k
f
.
end
=
y2k
self
.
assertFalse
(
now
.
isoformat
()
in
f
.
to_string
(
))
self
.
assertFalse
(
now
.
isoformat
()
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'2000-01-01'
in
f
.
to_string
(
))
self
.
assertTrue
(
'2000-01-01'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'TimeSpan>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'TimeSpan>'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'begin>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'begin>'
in
str
(
f
.
to_string
()
))
self
.
assertTrue
(
'end>'
in
f
.
to_string
(
))
self
.
assertTrue
(
'end>'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'TimeStamp>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'TimeStamp>'
in
str
(
f
.
to_string
()
))
self
.
assertFalse
(
'when>'
in
f
.
to_string
(
))
self
.
assertFalse
(
'when>'
in
str
(
f
.
to_string
()
))
#We manipulate our Feature so it has timespan and stamp
#We manipulate our Feature so it has timespan and stamp
ts
=
kml
.
TimeStamp
(
timestamp
=
now
)
ts
=
kml
.
TimeStamp
(
timestamp
=
now
)
f
.
_time_stamp
=
ts
f
.
_time_stamp
=
ts
...
@@ -859,15 +859,15 @@ class AtomTestCase( unittest.TestCase ):
...
@@ -859,15 +859,15 @@ class AtomTestCase( unittest.TestCase ):
self
.
assertEqual
(
a
.
name
,
"Christian Ledermann"
)
self
.
assertEqual
(
a
.
name
,
"Christian Ledermann"
)
a
.
uri
=
'http://iwlearn.net'
a
.
uri
=
'http://iwlearn.net'
a
.
email
=
'christian@gmail.com'
a
.
email
=
'christian@gmail.com'
self
.
assertTrue
(
"Christian Ledermann"
in
a
.
to_string
(
))
self
.
assertTrue
(
"Christian Ledermann"
in
str
(
a
.
to_string
()
))
self
.
assertTrue
(
'http://iwlearn.net'
in
a
.
to_string
(
))
self
.
assertTrue
(
'http://iwlearn.net'
in
str
(
a
.
to_string
()
))
self
.
assertTrue
(
'christian@gmail.com'
in
a
.
to_string
(
))
self
.
assertTrue
(
'christian@gmail.com'
in
str
(
a
.
to_string
()
))
self
.
assertTrue
(
'name>'
in
a
.
to_string
(
))
self
.
assertTrue
(
'name>'
in
str
(
a
.
to_string
()
))
self
.
assertTrue
(
'uri>'
in
a
.
to_string
(
))
self
.
assertTrue
(
'uri>'
in
str
(
a
.
to_string
()
))
self
.
assertTrue
(
'email>'
in
a
.
to_string
(
))
self
.
assertTrue
(
'email>'
in
str
(
a
.
to_string
()
))
#print (a.to_string())
#print (a.to_string())
a
.
email
=
'christian'
a
.
email
=
'christian'
self
.
assertFalse
(
'email>'
in
a
.
to_string
(
))
self
.
assertFalse
(
'email>'
in
str
(
a
.
to_string
()
))
def
test_link
(
self
):
def
test_link
(
self
):
...
@@ -878,15 +878,15 @@ class AtomTestCase( unittest.TestCase ):
...
@@ -878,15 +878,15 @@ class AtomTestCase( unittest.TestCase ):
l
.
type
=
"text/html"
l
.
type
=
"text/html"
l
.
hreflang
=
'en'
l
.
hreflang
=
'en'
l
.
lenght
=
"4096"
l
.
lenght
=
"4096"
self
.
assertTrue
(
'href="http://localhost/"'
in
l
.
to_string
(
))
self
.
assertTrue
(
'href="http://localhost/"'
in
str
(
l
.
to_string
()
))
self
.
assertTrue
(
'rel="alternate"'
in
l
.
to_string
(
))
self
.
assertTrue
(
'rel="alternate"'
in
str
(
l
.
to_string
()
))
self
.
assertTrue
(
'title="Title"'
in
l
.
to_string
(
))
self
.
assertTrue
(
'title="Title"'
in
str
(
l
.
to_string
()
))
self
.
assertTrue
(
'hreflang="en"'
in
l
.
to_string
(
))
self
.
assertTrue
(
'hreflang="en"'
in
str
(
l
.
to_string
()
))
self
.
assertTrue
(
'type="text/html"'
in
l
.
to_string
(
))
self
.
assertTrue
(
'type="text/html"'
in
str
(
l
.
to_string
()
))
self
.
assertTrue
(
'lenght="4096"'
in
l
.
to_string
(
))
self
.
assertTrue
(
'lenght="4096"'
in
str
(
l
.
to_string
()
))
self
.
assertTrue
(
'link'
in
l
.
to_string
(
))
self
.
assertTrue
(
'link'
in
str
(
l
.
to_string
()
))
self
.
assertTrue
(
'="http://www.w3.org/2005/Atom"'
in
l
.
to_string
(
))
self
.
assertTrue
(
'="http://www.w3.org/2005/Atom"'
in
str
(
l
.
to_string
()
))
#print (
l.to_string(
))
#print (
str(l.to_string()
))
l
.
href
=
None
l
.
href
=
None
self
.
assertRaises
(
ValueError
,
l
.
to_string
)
self
.
assertRaises
(
ValueError
,
l
.
to_string
)
...
...
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