allow dots in property names

pull/146/head
Johannes Raggam 2014-07-14 14:11:16 +02:00
rodzic 75f2819bfc
commit 188ee26070
2 zmienionych plików z 28 dodań i 1 usunięć

Wyświetl plik

@ -5,16 +5,20 @@ Changelog
3.8 (unreleased) 3.8 (unreleased)
---------------- ----------------
- Allow dots in property names. Refs #143.
[untitaker]
- Change class representation for CaselessDict objects to always include the - Change class representation for CaselessDict objects to always include the
class name or the class' name attribute, if available. Also show class name or the class' name attribute, if available. Also show
subcomponents for Component objects. subcomponents for Component objects.
[thet] [thet]
- Don't use data_encode for CaselessDict class representation but use dict's - Don't use data_encode for CaselessDict class representation but use dict's
__repr__ method. __repr__ method.
[t-8ch] [t-8ch]
- Handle parameters with multiple values, which is needed for VCard 3.0. - Handle parameters with multiple values, which is needed for VCard 3.0.
Refs #142.
[t-8ch] [t-8ch]

Wyświetl plik

@ -293,3 +293,26 @@ END:VCALENDAR"""
ctl.parts(), ctl.parts(),
(u'TEL', Parameters({'TYPE': ['HOME', 'VOICE']}), u'000000000'), (u'TEL', Parameters({'TYPE': ['HOME', 'VOICE']}), u'000000000'),
) )
def test_issue_143(self):
"""Issue #143 - Allow dots in property names.
Another vCard related issue.
https://github.com/collective/icalendar/pull/143
"""
from icalendar.parser import Contentline, Parameters
ctl = Contentline.from_ical("ITEMADRNULLTHISISTHEADRESS08158SOMECITY12345.ADR:;;This is the Adress 08; Some City;;12345;Germany") # nopep8
self.assertEqual(
ctl.parts(),
(u'ITEMADRNULLTHISISTHEADRESS08158SOMECITY12345.ADR',
Parameters(),
u';;This is the Adress 08; Some City;;12345;Germany'),
)
ctl2 = Contentline.from_ical("ITEMADRNULLTHISISTHEADRESS08158SOMECITY12345.X-ABLABEL:") # nopep8
self.assertEqual(
ctl2.parts(),
(u'ITEMADRNULLTHISISTHEADRESS08158SOMECITY12345.X-ABLABEL',
Parameters(),
u''),
)