| Index: scripts/master/unittests/annotator_test.py
|
| diff --git a/scripts/master/unittests/annotator_test.py b/scripts/master/unittests/annotator_test.py
|
| index fee77962847545fa13b39a2594298f34ac0b8347..7d742b7e8de242d25ae12eae82d39ef6aecdc139 100755
|
| --- a/scripts/master/unittests/annotator_test.py
|
| +++ b/scripts/master/unittests/annotator_test.py
|
| @@ -71,6 +71,7 @@ class FakeBuildstepStatus(mock.Mock):
|
| mock.Mock.__init__(self)
|
| self.name = name
|
| self.urls = {}
|
| + self.aliases = {}
|
| self.build = build
|
| self.text = None
|
| self.step = None
|
| @@ -96,9 +97,15 @@ class FakeBuildstepStatus(mock.Mock):
|
| def getURLs(self):
|
| return self.urls.copy()
|
|
|
| + def getAliases(self):
|
| + return self.aliases.copy()
|
| +
|
| def addURL(self, label, url):
|
| self.urls[label] = url
|
|
|
| + def addAlias(self, label, url, text=None):
|
| + self.aliases.setdefault(label, []).append((text, url))
|
| +
|
| def addLog(self, log):
|
| l = FakeLog(log)
|
| self.logs.append(l)
|
| @@ -217,7 +224,7 @@ class AnnotatorCommandsTest(unittest.TestCase):
|
|
|
| def testStepLink(self):
|
| self.handleOutputLine('@@@STEP_LINK@label@http://localhost/@@@')
|
| - testurls = [('label', 'http://localhost/')]
|
| + testurls = [('label', 'http://localhost/', None)]
|
| testurl_hash = {'label': 'http://localhost/'}
|
|
|
| annotatedLinks = [x['links'] for x in self.step.script_observer.sections]
|
| @@ -227,6 +234,18 @@ class AnnotatorCommandsTest(unittest.TestCase):
|
| self.assertEquals(annotatedLinks, [testurls])
|
| self.assertEquals(stepLinks, [testurl_hash])
|
|
|
| + def testStepAlias(self):
|
| + self.handleOutputLine('@@@STEP_LINK@alias-->label@http://localhost/@@@')
|
| + testurls = [('label', 'http://localhost/', 'alias')]
|
| + testalias_hash = {'label': [('alias', 'http://localhost/')]}
|
| +
|
| + annotatedLinks = [x['links'] for x in self.step.script_observer.sections]
|
| + stepAliases = [x['step'].getAliases() for x in
|
| + self.step.script_observer.sections]
|
| +
|
| + self.assertEquals(annotatedLinks, [testurls])
|
| + self.assertEquals(stepAliases, [testalias_hash])
|
| +
|
| def testStepWarning(self):
|
| self.handleOutputLine('@@@STEP_WARNINGS@@@')
|
| self.handleOutputLine('@@@BUILD_STEP step@@@')
|
|
|