-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathintegrationTests.js
214 lines (213 loc) · 8.11 KB
/
integrationTests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
var masterParser = require('./masterParser');
function doFile(url, expect) {
masterParser.parse(url, 'input', function(err, data) {
delete data.data;
if(err) {
console.log('********** FAIL '+url+': '+err);
} else {
for(var i in expect) {
if(!data[i]) {
console.log(data);
console.log('********** FAIL '+url+': missing data.'+i);
} else {
for(var j in expect[i]) {
if(data[i][j] != expect[i][j]) {
console.log(data);
console.log('********** FAIL '+url+': expected '+expect[i][j]+' instead of '+data[i][j]+' for data.'+i+'.'+j);
} else {
console.log('PASS '+url+' '+i+' '+j);
}
}
}
}
for(var i in data) {
if(!expect[i]) {
console.log('********** EXTRA '+url+': extra category.'+i);
} else {
for(var j in data[i]) {
if(expect[i][j] != data[i][j]) {
console.log('********** EXTRA '+url+': expected '+expect[i][j]+' instead of '+data[i][j]+' for data.'+i+'.'+j);
}
}
}
}
}
});
}
masterParser.setEnv('live');
doFile('[email protected]', {
textFields:
{ fullName: 'Michiel de Jong',
bio: 'Lived in Bali last winter and was \'the guy that did unhosted\'. Now live in Berlin and proud to be just one of many \'people who do unhosted\'.',
nick: 'michielbdejong',
type: 'user' },
images: { avatar: 'http://avatar.identi.ca/425878-480-20110427110559.jpeg' },
documents: {
'http://identi.ca/michielbdejong/foaf': 'describedby',
'http://identi.ca/user/425878': true,
'http://identi.ca/main/xrd?uri=acct:[email protected]': 'lrdd' },
follows:
{ 'http://identi.ca/user/425878': true,
'http://identi.ca/user/136': true,
'http://identi.ca/user/126137': true,
'http://identi.ca/user/432896': true,
'http://identi.ca/user/44188': true,
'http://identi.ca/user/465489': true,
'http://identi.ca/user/58458': true,
'http://identi.ca/user/453647': true,
'http://identi.ca/user/499580': true },
tools: {
'http://identi.ca/michielbdejong': 'R',
'http://identi.ca/api/statuses/user_timeline/425878.atom': 'S',
}
});
doFile('[email protected]', {
documents: {
'https://revolutionari.es/profile/michiel': true,
'https://revolutionari.es/hcard/michiel': 'hcard',
'https://revolutionari.es/poco/michiel': 'poco',
'https://revolutionari.es/xrd/?uri=acct:[email protected]': 'lrdd' },
textFields: { fullName: 'Michiel De Jong', type: 'user' },
images: { avatar: 'https://revolutionari.es/photo/custom/50/55.jpg' },
follows:
{ 'http://friendika.skilledtests.com/profile/erkan_yilmaz': true,
'https://macgirvin.com/profile/mike': true,
'http://bjerke.dk/ven/profile/flemming': true,
'http://prate.io/profile/mike': true,
'https://friendica.eu/profile/thomas_bierey': true,
'http://friendika.hipatia.net/profile/lnxwalt': true,
'http://friend.elsmussols.net/profile/elmussol': true,
'https://kakste.com/profile/bruce': true,
'http://kirgroup.com/profile/fabrixxm': true,
'https://fnode.schirr.org/profile/harry': true,
'https://friendica.dszdw.net/profile/klaus': true,
'https://friendica.mafiaspiel.org/profile/leberwurscht': true },
tools: {
'https://revolutionari.es/dfrn_poll/michiel': 'S',
'https://revolutionari.es/profile/michiel': 'R'
}
});
doFile('[email protected]', {
documents: {
'http://www.google.com/s2/webfinger/?q=acct:[email protected]': 'lrdd',
'http://www.google.com/profiles/dejong.michiel': 'hcard',
'http://www-opensocial.googleusercontent.com/api/people/108912615873187638071/': 'poco-me',
'http://www.google.com/s2/webfinger/?q=acct%3Adejong.michiel%40gmail.com&fmt=foaf': 'describedby' },
textFields: { fullName: 'Michiel de Jong', nick: 'dejong.michiel', type: 'user' },
images: { avatar: 'http://www.google.com/ig/c/photos/public/AIbEiAIAAABDCLfW7aamnf7XeyILdmNhcmRfcGhvdG8qKGIwYzNhNDg4ZWEwMTg4OWUwOGJmYzViZGU1NTQ0YzY0MWQ2Y2I2YWIwAf39FvvCldqF7AbAvi1Dprjs7_jF' },
follows: {},
tools: {
'mailto:[email protected]': 'M',
'xmpp:[email protected]': 'SM',
'http://www.google.com/profiles/dejong.michiel': 'R',
'https://www.googleapis.com/buzz/v1/activities/108912615873187638071/@public': 'S',
}
});
doFile('https://api.twitter.com/1/users/show.json?screen_name=michielbdejong', {
textFields:
{ fullName: 'Michiel de Jong',
bio: 'Freedom hacker at unhosted.org',
nick: 'michielbdejong',
locale: 'en',
type: 'user'},
images: { avatar: 'http://a0.twimg.com/profile_images/2194941545/picresized_th_5a6d23f1e8567cc9ccdac00ace4761c7_normal.jpg' },
follows: {},
tools: {
'https://twitter.com/michielbdejong': 'R',
'twitter:michielbdejong': 'RSM'
}
});
doFile('https://graph.facebook.com/dejong.michiel', {
textFields:
{ fullName: 'Michiel De Jong',
nick: 'dejong.michiel',
locale: 'en_US',
gender: 'male',
type: 'user'},
documents: {},
images: { avatar: 'https://graph.facebook.com/dejong.michiel/picture' },
follows: {},
tools: {
'mailto:[email protected]': 'M',
'xmpp:[email protected]': 'SM',
'https://facebook.com/dejong.michiel': 'R',
'facebook:dejong.michiel': 'RSCM'
}
});
doFile('[email protected]', {
textFields: { fullName: 'Michiel de Jong', type: 'user' },
images: { avatar: 'https://joindiaspora.s3.amazonaws.com/uploads/images/thumb_small_ffbd568ab8d948d72703.jpg' },
documents: {
'https://joindiaspora.com/webfinger?q=acct:[email protected]': 'lrdd',
'https://joindiaspora.com/hcard/users/e583028f23ce0302': 'hcard' },
follows: {},
tools: {
'https://joindiaspora.com/u/michielbdejong': 'R',
'https://joindiaspora.com/public/michielbdejong.atom': 'S',
}
});
doFile('http://melvincarvalho.com/', {
textFields: { fullName: 'Melvin Carvalho', nick: 'melvincarvalho', type: 'user' },
images: { avatar: 'http://melvincarvalho.com/melvincarvalho.png' },
documents: {},
follows:
{ 'http://bblfish.net/people/henry/card#me': true,
'http://webr3.org/nathan#me': true,
'http://tobyinkster.co.uk/#i': true,
'http://sw-app.org/mic.xhtml#i': true,
'http://wojciechpolak.org/foaf.rdf#me': true,
'https://my-profile.eu/people/deiu/card#me': true,
'http://id.myopenlink.net/dataspace/person/KingsleyUyiIdehen#this': true,
'http://mmt.me.uk/foaf.rdf#mischa': true,
'http://bart.netage.nl/foaf#bvl': true,
'http://presbrey.mit.edu/foaf#presbrey': true,
'http://www.bergnet.org/people/bergi/card#me': true },
tools: {
'mailto:[email protected]': 'M',
}
});
doFile('http://tantek.com/', {
textFields: { fullName: 'Tantek Çelik', nick: 'tantekc' },
images: {},
documents: {},
follows: {},
tools: {}
});
doFile('http://www.w3.org/People/Berners-Lee/card.rdf', {
textFields:
{ fullName: 'Tim Berners-Lee',
nick: 'tim.bernerslee.9',
locale: 'en_US',
gender: 'male',
type: 'user' },
images: { avatar: 'https://graph.facebook.com/tim.bernerslee.9/picture' },
documents:
{ 'http://graph.facebook.com/512908782#': 'magic',
'http://identi.ca/user/45563': 'magic',
'http://www.advogato.org/person/timbl/foaf.rdf#me': 'magic',
'http://www4.wiwiss.fu-berlin.de/bookmashup/persons/Tim+Berners-Lee': 'magic',
'http://www4.wiwiss.fu-berlin.de/dblp/resource/person/100007': 'magic' },
follows: { 'http://www.w3.org/People/Berners-Lee/card#i': true },
tools:
{ 'mailto:[email protected]': 'M',
'xmpp:[email protected]': 'SM',
'https://facebook.com/tim.bernerslee.9': 'R',
'facebook:tim.bernerslee.9': 'RSCM' }
});
doFile('[email protected]', {
textFields: {
type: 'user',
fullName: 'Michiel Leenaars'
},
images: {
'avatar': 'http://nlnet.nl/people/leenaars.png'
},
documents: {
'http://nlnet.nl/people/acct:[email protected]': 'lrdd',
'http://www.nlnet.nl/people/leenaars.hcard': 'hcard'
},
follows: {},
tools: {
'http://www.nlnet.nl/people/leenaars.html': 'R'
}
});