Changeset 26:59ace4d1df68 in ralphm-patches for form-missing-tests.patch


Ignore:
Timestamp:
Jan 1, 2010, 4:18:52 PM (12 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Clean up patches, more tests, adjust copyright statements to new year.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • form-missing-tests.patch

    r24 r26  
     1Add missing tests for Data Forms and correct some minor issues.
     2
    13diff -r 3ef9bc7a0d70 wokkel/data_form.py
    24--- a/wokkel/data_form.py       Wed Dec 30 16:53:05 2009 +0100
    3 +++ b/wokkel/data_form.py       Fri Jan 01 01:21:56 2010 +0100
     5+++ b/wokkel/data_form.py       Fri Jan 01 15:54:26 2010 +0100
     6@@ -1,6 +1,6 @@
     7 # -*- test-case-name: wokkel.test.test_data_form -*-
     8 #
     9-# Copyright (c) 2003-2009 Ralph Meijer
     10+# Copyright (c) 2003-2010 Ralph Meijer
     11 # See LICENSE for details.
     12 
     13 """
    414@@ -251,10 +251,10 @@
    515             field['var'] = self.var
     
    112122diff -r 3ef9bc7a0d70 wokkel/test/test_data_form.py
    113123--- a/wokkel/test/test_data_form.py     Wed Dec 30 16:53:05 2009 +0100
    114 +++ b/wokkel/test/test_data_form.py     Fri Jan 01 01:21:56 2010 +0100
    115 @@ -19,14 +19,67 @@
     124+++ b/wokkel/test/test_data_form.py     Fri Jan 01 15:54:26 2010 +0100
     125@@ -1,4 +1,4 @@
     126-# Copyright (c) 2003-2009 Ralph Meijer
     127+# Copyright (c) 2003-2010 Ralph Meijer
     128 # See LICENSE for details.
     129 
     130 """
     131@@ -19,14 +19,73 @@
    116132     """
    117133 
    118134     def test_toElement(self):
     135+        """
     136+        An option is an option element with a value child with the option value.
     137+        """
    119138+        option = data_form.Option('value')
    120139+        element = option.toElement()
     
    128147+
    129148+    def test_toElementLabel(self):
     149+        """
     150+        A label is rendered as an attribute on the option element.
     151+        """
    130152         option = data_form.Option('value', 'label')
    131153         element = option.toElement()
     
    187209 
    188210 
    189 @@ -44,6 +97,21 @@
     211@@ -44,6 +103,21 @@
    190212         self.assertEqual('test', field.var)
    191213 
     
    209231         """
    210232         Test rendering to a DOM.
    211 @@ -130,12 +198,44 @@
     233@@ -130,12 +204,44 @@
    212234 
    213235 
     
    254276         """
    255277         A field not of type fixed must have a var.
    256 @@ -250,6 +350,7 @@
     278@@ -250,6 +356,7 @@
    257279         field = data_form.Field.fromElement(element)
    258280         self.assertEquals(u'user@example.org', field.value)
     
    262284         """
    263285         Parsed jid-single field values should be of type C{unicode}.
    264 @@ -275,6 +376,85 @@
     286@@ -275,6 +382,85 @@
    265287         self.assertEquals(u'false', field.value)
    266288 
     
    348370 class FormTest(unittest.TestCase):
    349371     """
    350 @@ -289,11 +469,13 @@
     372@@ -289,6 +475,7 @@
    351373         form = data_form.Form('result')
    352374         self.assertEqual('result', form.formType)
     
    356378         """
    357379         The toElement method returns a form's DOM representation.
    358          """
    359          form = data_form.Form('result')
    360 +
    361          element = form.toElement()
    362  
    363          self.assertTrue(domish.IElement.providedBy(element))
    364 @@ -303,6 +485,105 @@
     380@@ -303,6 +490,105 @@
    365381         self.assertEquals([], element.children)
    366382 
     
    468484         """
    469485         C{fromElement} creates a L{data_form.Form} from a DOM representation.
    470 @@ -348,6 +629,7 @@
     486@@ -348,6 +634,7 @@
    471487 
    472488         self.assertEquals(['instruction'], form.instructions)
     
    476492         element = domish.Element((NS_X_DATA, 'x'))
    477493         element.addElement('instructions', content='instruction 1')
    478 @@ -377,3 +659,173 @@
     494@@ -377,3 +664,173 @@
    479495         self.assertEquals('field1', form.fieldList[0].var)
    480496         self.assertIn('field2', form.fields)
Note: See TracChangeset for help on using the changeset viewer.