fixup fontset tests
This commit is contained in:
parent
b820cf7807
commit
84b7d198d4
3 changed files with 10 additions and 4 deletions
7
tests/data/broken_maps/missing_fontset.xml
Normal file
7
tests/data/broken_maps/missing_fontset.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<Map>
|
||||||
|
|
||||||
|
<FontSet name="book-fonts">
|
||||||
|
<Font face-name="does not exist" />
|
||||||
|
</FontSet>
|
||||||
|
|
||||||
|
</Map>
|
|
@ -3,7 +3,6 @@
|
||||||
<FontSet name="book-fonts">
|
<FontSet name="book-fonts">
|
||||||
<Font face-name="DejaVu Sans Book" />
|
<Font face-name="DejaVu Sans Book" />
|
||||||
<Font face-name="DejaVu Sans Oblique" />
|
<Font face-name="DejaVu Sans Oblique" />
|
||||||
<Font face-name="does not exist" />
|
|
||||||
</FontSet>
|
</FontSet>
|
||||||
|
|
||||||
</Map>
|
</Map>
|
||||||
|
|
|
@ -13,10 +13,10 @@ def setup():
|
||||||
|
|
||||||
def test_loading_fontset_from_map():
|
def test_loading_fontset_from_map():
|
||||||
m = mapnik.Map(256,256)
|
m = mapnik.Map(256,256)
|
||||||
mapnik.load_map(m,'../data/good_maps/fontset.xml')
|
mapnik.load_map(m,'../data/good_maps/fontset.xml',True)
|
||||||
fs = m.find_fontset('book-fonts')
|
fs = m.find_fontset('book-fonts')
|
||||||
eq_(len(fs.names),3)
|
eq_(len(fs.names),2)
|
||||||
eq_(list(fs.names),['DejaVu Sans Book','DejaVu Sans Oblique', 'does not exist'])
|
eq_(list(fs.names),['DejaVu Sans Book','DejaVu Sans Oblique'])
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue