Skip to content

Commit ba963de

Browse files
committed
py3 tests ok
1 parent d30b08a commit ba963de

File tree

3 files changed

+2
-7
lines changed

3 files changed

+2
-7
lines changed

pyArango/document.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ def validate(self) :
7575
res = {}
7676
for field in self.validators.keys() :
7777
try :
78-
# print field, self.store[field]
79-
# if type(self.validators[field]) is types.DictType and field not in self.store :
8078
if isinstance(self.validators[field], dict) and field not in self.store :
8179
self.store[field] = DocumentStore(self.collection, validators = self.validators[field], initDct = {}, subStore=True)
8280
self.validateField(field)
@@ -99,7 +97,6 @@ def set(self, dct) :
9997

10098
for field, value in dct.items() :
10199
if field not in self.collection.arangoPrivates :
102-
# if type(value) is types.DictType :
103100
if isinstance(value, dict) :
104101
if field in self.validators :
105102
vals = self.validators[field]
@@ -112,7 +109,6 @@ def set(self, dct) :
112109

113110
def __getitem__(self, field) :
114111
"""Get an element from the store"""
115-
# if (field in self.validators) and (type(self.validators[field]) is types.DictType) and (field not in self.store) :
116112
if (field in self.validators) and isinstance(self.validators[field], dict) and (field not in self.store) :
117113
self.store[field] = DocumentStore(self.collection, validators = self.validators[field], initDct = {}, patch = self.patching, subStore=True)
118114
self.subStores[field] = self.store[field]
@@ -134,7 +130,6 @@ def __setitem__(self, field, value) :
134130
if field in self.collection.arangoPrivates :
135131
raise ValueError("DocumentStore cannot contain private field (got %s)" % field)
136132

137-
# if type(value) is types.DictType :
138133
if isinstance(value, dict) :
139134
if field in self.validators :
140135
vals = self.validators[field]

pyArango/tests/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def test_fields_on_save(self) :
309309
class String_val(VAL.Validator) :
310310

311311
def validate(self, value) :
312-
if type(value) is not bytes :
312+
if not isinstance(value, bytes) and not isinstance(value, str) :
313313
raise ValidationError("Field value must be a string")
314314
return True
315315

pyArango/theExceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(self, errors) :
5353
pyArangoException.__init__(self, message, errors)
5454

5555
def __str__(self) :
56-
self.rors = []
56+
self.strErrors = []
5757
for k, v in self.errors.items() :
5858
strErrors.append("%s -> %s" % (k, v))
5959
strErrors = '\n\t'.join(strErrors)

0 commit comments

Comments
 (0)