From 0b8e0f869a491610c788e4c3b657aecb45f64617 Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 24 Jan 2007 22:04:18 +0100 Subject: [PATCH] [svn r37297] Fixed dependency on order in the function argument formatting tests. --HG-- branch : trunk --- py/apigen/testing/test_apigen_example.py | 29 ++++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/py/apigen/testing/test_apigen_example.py b/py/apigen/testing/test_apigen_example.py index 0cc2fddc2..4d8be2117 100644 --- a/py/apigen/testing/test_apigen_example.py +++ b/py/apigen/testing/test_apigen_example.py @@ -127,16 +127,25 @@ class TestApiPageBuilder(AbstractBuilderTest): snippet = apb.build_callable_view('main.sub.func') html = snippet.unicode() print html - run_string_sequence_test(html, [ - 'arg1 : AnyOf(', - 'href="', - 'Class SomeClass', - 'Int>', - 'return value:', - '<None>', - 'source: %s' % (self.fs_root.join('pkg/func.py'),), - 'def func(arg1):', - ]) + # XXX somewhat grokky tests because the order of the items may change + assert 'arg1: AnyOf(' in html + pos1 = html.find('arg1: AnyOf(') + assert pos1 > -1 + pos2 = html.find('href="', pos1) + assert pos2 > pos1 + pos3 = html.find('Class SomeClass', pos2) + assert pos3 > pos2 + pos4 = html.find('Int>', pos1) + assert pos4 > pos1 + pos5 = html.find('return value:', pos4) + assert pos5 > pos4 and pos5 > pos3 + pos6 = html.find('<None>', pos5) + assert pos6 > pos5 + pos7 = html.find('source: %s' % (self.fs_root.join('pkg/func.py'),), + pos6) + assert pos7 > pos6 + pos8 = html.find('def func(arg1):', pos7) + assert pos8 > pos7 _checkhtmlsnippet(html) def test_build_function_pages(self):