Skip to content

Commit 716b360

Browse files
committed
make sure everything is sorted in the xmlrpc schema
1 parent 58c22fa commit 716b360

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

roundup/xmlrpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def schema(self):
7373
s = {}
7474
for c in self.db.classes:
7575
cls = self.db.classes[c]
76-
props = [(n,repr(v)) for n,v in cls.properties.items()]
76+
props = [(n,repr(v)) for n,v in sorted(cls.properties.items())]
7777
s[c] = props
7878
return s
7979

test/test_xmlrpc.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -101,48 +101,48 @@ def testFileCreate(self):
101101
self.assertEqual(results['content'], 'hello\r\nthere')
102102

103103
def testSchema(self):
104-
schema={'status': [('order', '<roundup.hyperdb.Number>'),
105-
('name', '<roundup.hyperdb.String>')],
104+
schema={'status': [('name', '<roundup.hyperdb.String>'),
105+
('order', '<roundup.hyperdb.Number>')],
106106
'keyword': [('name', '<roundup.hyperdb.String>')],
107-
'priority': [('order', '<roundup.hyperdb.Number>'),
108-
('name', '<roundup.hyperdb.String>')],
109-
'user': [('username', '<roundup.hyperdb.String>'),
107+
'priority': [('name', '<roundup.hyperdb.String>'),
108+
('order', '<roundup.hyperdb.Number>')],
109+
'user': [('address', '<roundup.hyperdb.String>'),
110110
('alternate_addresses', '<roundup.hyperdb.String>'),
111-
('realname', '<roundup.hyperdb.String>'),
112-
('roles', '<roundup.hyperdb.String>'),
113111
('organisation', '<roundup.hyperdb.String>'),
114-
('queries', '<roundup.hyperdb.Multilink to "query">'),
112+
('password', '<roundup.hyperdb.Password>'),
115113
('phone', '<roundup.hyperdb.String>'),
116-
('address', '<roundup.hyperdb.String>'),
114+
('queries', '<roundup.hyperdb.Multilink to "query">'),
115+
('realname', '<roundup.hyperdb.String>'),
116+
('roles', '<roundup.hyperdb.String>'),
117117
('timezone', '<roundup.hyperdb.String>'),
118-
('password', '<roundup.hyperdb.Password>')],
118+
('username', '<roundup.hyperdb.String>')],
119119
'file': [('content', '<roundup.hyperdb.String>'),
120-
('type', '<roundup.hyperdb.String>'),
121-
('name', '<roundup.hyperdb.String>')],
122-
'msg': [('files', '<roundup.hyperdb.Multilink to "file">'),
120+
('name', '<roundup.hyperdb.String>'),
121+
('type', '<roundup.hyperdb.String>')],
122+
'msg': [('author', '<roundup.hyperdb.Link to "user">'),
123+
('content', '<roundup.hyperdb.String>'),
124+
('date', '<roundup.hyperdb.Date>'),
125+
('files', '<roundup.hyperdb.Multilink to "file">'),
123126
('inreplyto', '<roundup.hyperdb.String>'),
124-
('tx_Source', '<roundup.hyperdb.String>'),
127+
('messageid', '<roundup.hyperdb.String>'),
125128
('recipients', '<roundup.hyperdb.Multilink to "user">'),
126-
('author', '<roundup.hyperdb.Link to "user">'),
127129
('summary', '<roundup.hyperdb.String>'),
128-
('content', '<roundup.hyperdb.String>'),
129-
('messageid', '<roundup.hyperdb.String>'),
130-
('date', '<roundup.hyperdb.Date>'),
130+
('tx_Source', '<roundup.hyperdb.String>'),
131131
('type', '<roundup.hyperdb.String>')],
132-
'query': [('url', '<roundup.hyperdb.String>'),
133-
('private_for', '<roundup.hyperdb.Link to "user">'),
132+
'query': [('klass', '<roundup.hyperdb.String>'),
134133
('name', '<roundup.hyperdb.String>'),
135-
('klass', '<roundup.hyperdb.String>')],
136-
'issue': [('status', '<roundup.hyperdb.Link to "status">'),
134+
('private_for', '<roundup.hyperdb.Link to "user">'),
135+
('url', '<roundup.hyperdb.String>')],
136+
'issue': [('assignedto', '<roundup.hyperdb.Link to "user">'),
137137
('files', '<roundup.hyperdb.Multilink to "file">'),
138-
('tx_Source', '<roundup.hyperdb.String>'),
139138
('keyword', '<roundup.hyperdb.Multilink to "keyword">'),
140-
('title', '<roundup.hyperdb.String>'),
141-
('nosy', '<roundup.hyperdb.Multilink to "user">'),
142139
('messages', '<roundup.hyperdb.Multilink to "msg">'),
140+
('nosy', '<roundup.hyperdb.Multilink to "user">'),
143141
('priority', '<roundup.hyperdb.Link to "priority">'),
144-
('assignedto', '<roundup.hyperdb.Link to "user">'),
145-
('superseder', '<roundup.hyperdb.Multilink to "issue">')]}
142+
('status', '<roundup.hyperdb.Link to "status">'),
143+
('superseder', '<roundup.hyperdb.Multilink to "issue">'),
144+
('title', '<roundup.hyperdb.String>'),
145+
('tx_Source', '<roundup.hyperdb.String>')]}
146146

147147
results = self.server.schema()
148148
self.assertEqual(results, schema)

0 commit comments

Comments
 (0)