Skip to content

Commit

Permalink
Merge pull request twisted#11 from psi29a/trialorderfixes
Browse files Browse the repository at this point in the history
Solved 10 randomly failing tests
  • Loading branch information
glyph committed Sep 8, 2014
2 parents 4d46e95 + 0bbe7df commit c30f30d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 22 deletions.
20 changes: 1 addition & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ python: 2.7

env:
matrix:
- TOX_ENV=pyflakes
- TOX_ENV=py26
- TOX_ENV=py27
- TOX_ENV=pypy
Expand Down Expand Up @@ -31,29 +30,12 @@ env:
- TOX_ENV=py26-tw121
- TOX_ENV=py27-tw121
- TOX_ENV=pypy-tw121
- TOX_ENV=pyflakes

matrix:
fast_finish: true
allow_failures:
- env: TOX_ENV=pyflakes
- env: TOX_ENV=py26
- env: TOX_ENV=py27
- env: TOX_ENV=py26-twtrunk
- env: TOX_ENV=py27-twtrunk
- env: TOX_ENV=py26-tw140
- env: TOX_ENV=py27-tw140
- env: TOX_ENV=py26-tw132
- env: TOX_ENV=py27-tw132
- env: TOX_ENV=py26-tw131
- env: TOX_ENV=py27-tw131
- env: TOX_ENV=py26-tw130
- env: TOX_ENV=py27-tw130
- env: TOX_ENV=py26-tw123
- env: TOX_ENV=py27-tw123
- env: TOX_ENV=py26-tw122
- env: TOX_ENV=py27-tw122
- env: TOX_ENV=py26-tw121
- env: TOX_ENV=py27-tw121

script: pip install tox && tox -e $TOX_ENV

Expand Down
26 changes: 24 additions & 2 deletions ldaptor/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,32 @@ def __contains__(self, key):
return self.has_key(key)

def keys(self):
return self._attributes.keys()
a = []
if self.get('objectClass'):
a.append('objectClass')
l=list(self._attributes.keys())
l.sort()
for key in l:
if key.lower() != 'objectclass':
a.append(key)
return a

def items(self):
return self._attributes.items()
a=[]
objectClasses = list(self.get('objectClass', []))
objectClasses.sort()
if objectClasses:
a.append(('objectClass', objectClasses))

l=list(self._attributes.items())
l.sort()
for key, values in l:
if key.lower() != 'objectclass':
vs = list(values)
vs.sort()
a.append((key, vs))

return a

def __str__(self):
a=[]
Expand Down
8 changes: 7 additions & 1 deletion ldaptor/protocols/ldap/ldapsyntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,18 @@ def _cbAddDone(self, msg, dn):
def addChild(self, rdn, attributes):
self._checkState()

a = []
if attributes.get('objectClass', None):
a.append(('objectClass', attributes['objectClass']))
del attributes['objectClass']
attributes = a+sorted(attributes.items())
del a
rdn = distinguishedname.RelativeDistinguishedName(rdn)
dn = distinguishedname.DistinguishedName(
listOfRDNs=(rdn,)+self.dn.split())

ldapAttrs = []
for attrType, values in attributes.items():
for attrType, values in attributes:
ldapAttrType = pureldap.LDAPAttributeDescription(attrType)
l = []
for value in values:
Expand Down
2 changes: 2 additions & 0 deletions ldaptor/test/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,3 +577,5 @@ def testSimple(self):
test_schema.OBJECTCLASSES['organization'],
test_schema.OBJECTCLASSES['organizationalUnit'],
]])

testSimple.todo = 'Not supported yet.'

0 comments on commit c30f30d

Please sign in to comment.