Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Jajcus/pyxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJacek Konieczny <jajcus@jajcus.net>2004-03-22 22:58:42 +0300
committerJacek Konieczny <jajcus@jajcus.net>2004-03-22 22:58:42 +0300
commit2c4631dee9218bee641a27e1c3a7ef5d01d5acfc (patch)
tree2da87bf68e1d280afc079f88f0531503cbfcb580 /tests
parent82d7c37c9984bf6db691d5429f997aa675e15714 (diff)
- vcard test suite
Diffstat (limited to 'tests')
-rw-r--r--tests/.cvsignore1
-rwxr-xr-xtests/vcard.py14
-rw-r--r--tests/vcard1.xml47
-rw-r--r--tests/vcard2.txt10
4 files changed, 72 insertions, 0 deletions
diff --git a/tests/.cvsignore b/tests/.cvsignore
index 4e78408..ab8de8f 100644
--- a/tests/.cvsignore
+++ b/tests/.cvsignore
@@ -1,3 +1,4 @@
+*.out.*
pyxmpp
*.txt
log
diff --git a/tests/vcard.py b/tests/vcard.py
new file mode 100755
index 0000000..e071400
--- /dev/null
+++ b/tests/vcard.py
@@ -0,0 +1,14 @@
+#!/usr/bin/python
+
+import libxml2
+from pyxmpp.jabber import vcard
+
+xmldata=libxml2.parseFile("vcard1.xml")
+textdata=file("vcard2.txt").read()
+
+vc1=vcard.VCard(xmldata.getRootElement())
+print `vc1`
+file("vcard1.out.txt","w").write(vc1.rfc2426())
+vc2=vcard.VCard(textdata)
+print `vc2`
+file("vcard2.out.txt","w").write(vc2.rfc2426())
diff --git a/tests/vcard1.xml b/tests/vcard1.xml
new file mode 100644
index 0000000..8bda16e
--- /dev/null
+++ b/tests/vcard1.xml
@@ -0,0 +1,47 @@
+<vCard xmlns='vcard-temp'>
+ <FN>Peter Saint-Andre</FN>
+ <N>
+ <FAMILY>Saint-Andre</FAMILY>
+ <GIVEN>Peter</GIVEN>
+ <MIDDLE/>
+ </N>
+ <NICKNAME>stpeter</NICKNAME>
+ <URL>http://www.jabber.org/people/stpeter.php</URL>
+ <BDAY>1966-08-06</BDAY>
+ <ORG>
+ <ORGNAME>Jabber Software Foundation</ORGNAME>
+ <ORGUNIT/>
+ </ORG>
+ <TITLE>Executive Director</TITLE>
+ <ROLE>Patron Saint</ROLE>
+ <TEL><VOICE/><WORK/><NUMBER>303-308-3282</NUMBER></TEL>
+ <TEL><FAX/><WORK/><NUMBER/></TEL>
+ <TEL><MSG/><WORK/><NUMBER/></TEL>
+ <ADR>
+ <WORK/>
+ <EXTADD>Suite 600</EXTADD>
+ <STREET>1899 Wynkoop Street</STREET>
+ <LOCALITY>Denver</LOCALITY>
+ <REGION>CO</REGION>
+ <PCODE>80202</PCODE>
+ <CTRY>USA</CTRY>
+ </ADR>
+ <TEL><VOICE/><HOME/><NUMBER>303-555-1212</NUMBER></TEL>
+ <TEL><FAX/><HOME/><NUMBER/></TEL>
+ <TEL><MSG/><HOME/><NUMBER/></TEL>
+ <ADR>
+ <HOME/>
+ <EXTADD/>
+ <STREET/>
+ <LOCALITY>Denver</LOCALITY>
+ <REGION>CO</REGION>
+ <PCODE>80209</PCODE>
+ <CTRY>USA</CTRY>
+ </ADR>
+ <EMAIL><INTERNET/><PREF/><USERID>stpeter@jabber.org</USERID></EMAIL>
+ <JABBERID>stpeter@jabber.org</JABBERID>
+ <DESC>
+ More information about me is located on my
+ personal website: http://www.saint-andre.com/
+ </DESC>
+</vCard>
diff --git a/tests/vcard2.txt b/tests/vcard2.txt
new file mode 100644
index 0000000..d51e50a
--- /dev/null
+++ b/tests/vcard2.txt
@@ -0,0 +1,10 @@
+
+begin:VCARD
+source:ldap://cn=bjorn%20Jensen, o=university%20of%20Michigan, c=US
+name:Bjorn Jensen
+fn:Bj=F8rn Jensen
+n:Jensen;Bj=F8rn
+email;type=internet:bjorn@umich.edu
+tel;type=work,voice,msg:+1 313 747-4454
+key;type=x509;encoding=B:dGhpcyBjb3VsZCBiZSAKbXkgY2VydGlmaWNhdGUK
+end:VCARD