-#!/usr/bin/python2.6
+#!/usr/bin/python2.7
# -*- coding: iso-8859-15 -*-
import wrpylib.wrvalidators
import formencode
assert v.from_python(None) == u''
+# test_NeinValidator
+
+
+# test_Unicode
+
+
+# test_UnicodeNone
+
+
+# test_Unsigned
+
+
def test_UnsignedNone():
v = wrpylib.wrvalidators.UnsignedNone()
assert v.to_python(u'42') == 42
assert v.from_python(None) == u''
-def test_GeoNone():
- coord = u'47.076207 N 11.453553 E'
- v = wrpylib.wrvalidators.GeoNone()
- (lat, lon) = v.to_python(coord)
- assert lat == 47.076207
- assert lon == 11.453553
- assert v.to_python(u'') == (None, None)
+# test_UnsignedNeinNone
- assert v.from_python((lat, lon)) == coord
- assert v.from_python((None, None)) == u''
+
+# test_Loop
+
+
+# test_DictValidator
+
+
+# test_GermanBoolNone
def test_GermanTristateTuple():
assert v.from_python(0.5) == u'Teilweise'
+# test_ValueComment
+
+
+# test_SemicolonList
+
+
def test_ValueCommentList():
v = wrpylib.wrvalidators.ValueCommentList()
assert v.to_python(u'abc') == [(u'abc', None)]
assert v.to_python(u'value1 (comment1); [[link (linkcomment)]] (not easy)') == [(u'value1', u'comment1'), (u'[[link (linkcomment)]]', u'not easy')]
+# test_GenericDateTime
+
+
+# test_DateTimeNoSec
+
+
+# test_DateNone
+
+
+# test_Geo
+
+
+def test_GeoNone():
+ coord = u'47.076207 N 11.453553 E'
+ v = wrpylib.wrvalidators.GeoNone()
+ (lat, lon) = v.to_python(coord)
+ assert lat == 47.076207
+ assert lon == 11.453553
+ assert v.to_python(u'') == (None, None)
+
+ assert v.from_python((lat, lon)) == coord
+ assert v.from_python((None, None)) == u''
+
+
+# test_MultiGeo
+
+
+# test_AustrianPhoneNumber
+
+
+# test_AustrianPhoneNumberNone
+
+
+# test_AustrianPhoneNumberCommentLoop
+
+
+# test_GermanDifficulty
+
+
+# test_GermanAvalanches
+
+
+# test_GermanPublicTransport
+
+
+# test_GermanTristateFloatComment
+
+
+# test_UnsignedCommentNone
+
+
+# test_GermanCachet
+
+
+# test_url
+
+
def test_UrlNeinNone():
v = wrpylib.wrvalidators.UrlNeinNone()
assert v.to_python(u'') == None
assert v.from_python(None) == u''
assert v.from_python(u'Nein') == u'Nein'
assert v.from_python(u'T-Mobile (gut); A1') == u'T-Mobile (gut); A1'
+
+
+# test_PhoneNumber
def test_PhoneCommentListNeinLoopNone():
assert v.from_python(testvalue) == testvalue
-def test_GermanLift():
- v = wrpylib.wrvalidators.GermanLift()
- assert v.to_python(u'') == (None, None)
- assert v.to_python(u'Nein') == (False, None)
- assert v.to_python(u'Sessellift (4 Euro)') == (True, u'Sessellift (4 Euro)')
- assert v.from_python((None, None)) == u''
- assert v.from_python((False, None)) == u'Nein'
- assert v.from_python((True, u'Sessellift (4 Euro)')) == u'Sessellift (4 Euro)'
+# test_WikiPage
+
+
+# test_WikiPageList
def test_WikiPageListLoopNone():
assert v.from_python(u'[[Birgitzer Alm]]; [[Kemater Alm]]') == u'[[Birgitzer Alm]]; [[Kemater Alm]]'
+# test_TupleSecondValidator
+
+
def test_BoolUnicodeTupleValidator():
v = wrpylib.wrvalidators.BoolUnicodeTupleValidator()
assert v.to_python(u'') == (None, None)
assert v.from_python((True, u'any text')) == u'any text'
+
+
+def test_GermanLift():
+ v = wrpylib.wrvalidators.GermanLift()
+ assert v.to_python(u'') == (None, None)
+ assert v.to_python(u'Nein') == (False, None)
+ assert v.to_python(u'Sessellift (4 Euro)') == (True, u'Sessellift (4 Euro)')
+ assert v.from_python((None, None)) == u''
+ assert v.from_python((False, None)) == u'Nein'
+ assert v.from_python((True, u'Sessellift (4 Euro)')) == u'Sessellift (4 Euro)'
+
+
def test_SledRental():
v = wrpylib.wrvalidators.SledRental()
assert v.to_python(u'') == (None, None)