Merge pull request #187 from nthykier/fix-gh-186-shorten-id-recycle-used-ids
Enable shortenIDs to recycle existing IDs
This commit is contained in:
commit
4fe2655f86
3 changed files with 141 additions and 46 deletions
13
testscour.py
13
testscour.py
|
|
@ -2045,6 +2045,19 @@ class ShortenIDsOption(unittest.TestCase):
|
|||
'Did not update reference to shortened ID')
|
||||
|
||||
|
||||
class ShortenIDsStableOutput(unittest.TestCase):
|
||||
|
||||
def runTest(self):
|
||||
doc = scourXmlFile('unittests/shorten-ids-stable-output.svg',
|
||||
parse_args(['--shorten-ids']))
|
||||
use_tags = doc.getElementsByTagName('use')
|
||||
hrefs_ordered = [x.getAttributeNS('http://www.w3.org/1999/xlink', 'href')
|
||||
for x in use_tags]
|
||||
expected = ['#a', '#b', '#b']
|
||||
self.assertEquals(hrefs_ordered, expected,
|
||||
'--shorten-ids pointlessly reassigned ids')
|
||||
|
||||
|
||||
class MustKeepGInSwitch(unittest.TestCase):
|
||||
|
||||
def runTest(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue