Skip to content

Commit

Permalink
Making the test not fail with different versions of simplejson.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.getwindmill.com/trunk@1224 78c7df6f-8922-0410-bcd3-9426b1ad491b
  • Loading branch information
mikeal committed Apr 24, 2009
1 parent 0ea6603 commit c993825
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions test/python_tests/test_transforms.py
Expand Up @@ -43,6 +43,20 @@ def test_suite_name():
client.doubleClick(id=u'hourDiv1-1200')
client.waits.sleep(milliseconds=2000)
client.extensions.cosmoDragDrop(destination={u'id': u'hourDiv4-1300'}, dragged={u'pfx': u'eventDivContent__', u'jsid': u'windmill.testWindow.cosmo.view.cal.canvasInstance.getSelectedItemId()'})"""

other_proper_code = """# Generated by the windmill services transformer
from windmill.authoring import WindmillTestClient
def test_suite_name():
client = WindmillTestClient(__name__)
client.click(jsid='{$calView}')
client.click(jsid='{$calView}')
client.waits.forElement(id='hourDiv1-1200', timeout=40000)
client.click(id='viewNavCenterRight')
client.doubleClick(id='hourDiv1-1200')
client.waits.sleep(milliseconds=2000)
client.extensions.cosmoDragDrop(destination={'id': 'hourDiv4-1300'}, dragged={'pfx': 'eventDivContent__', 'jsid': 'windmill.testWindow.cosmo.view.cal.canvasInstance.getSelectedItemId()'})"""

def test_save_to_python():
import windmill
Expand All @@ -51,12 +65,10 @@ def test_save_to_python():
file_path = os.path.join(windmill.settings['SAVES_PATH'], file_name)
cleanup_files.append(file_path)
python_code = open(file_path, 'r').read()
if python_code != proper_python_code:
if python_code != proper_python_code or python_code != other_proper_code:
print python_code
assert python_code == proper_python_code
assert python_code == proper_python_code or python_code == other_proper_code

def teardown_module(module):
for f in module.cleanup_files:
os.remove(f)


os.remove(f)

0 comments on commit c993825

Please sign in to comment.