Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
persistent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
persistent
Commits
b3f5da74
Commit
b3f5da74
authored
Apr 09, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test the error message for setting a oid for consistencey between c and python.
parent
5e5c5540
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
persistent/persistence.py
persistent/persistence.py
+1
-2
persistent/tests/test_persistence.py
persistent/tests/test_persistence.py
+7
-4
No files found.
persistent/persistence.py
View file @
b3f5da74
...
...
@@ -385,8 +385,7 @@ class Persistent(object):
except
AttributeError
:
pass
else
:
cache
.
update_object_size_estimation
(
self
.
__oid
,
-
1
)
cache
.
update_object_size_estimation
(
self
.
__oid
,
-
1
)
# See notes in PickleCache.sweep for why we have to do this
cache
.
_persistent_deactivate_ran
=
True
...
...
persistent/tests/test_persistence.py
View file @
b3f5da74
...
...
@@ -115,8 +115,6 @@ class _Persistent_Base(object):
def
test_assign_p_jar_w_new_jar
(
self
):
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
()
new_jar
=
self
.
_makeJar
()
def
_test
():
inst
.
_p_jar
=
new_jar
try
:
inst
.
_p_jar
=
new_jar
except
ValueError
as
e
:
...
...
@@ -143,9 +141,14 @@ class _Persistent_Base(object):
def
test_assign_p_oid_w_invalid_oid
(
self
):
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
()
def
_test
():
try
:
inst
.
_p_oid
=
object
()
self
.
assertRaises
(
ValueError
,
_test
)
except
ValueError
as
e
:
self
.
assertEqual
(
str
(
e
),
'can not change _p_oid of cached object'
)
else
:
self
.
fail
(
"Should raise value error"
)
def
test_assign_p_oid_w_valid_oid
(
self
):
from
persistent.timestamp
import
_makeOctets
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment