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
1462ee2c
Commit
1462ee2c
authored
Dec 16, 2014
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
persistent.persistence: 100% branch coverage.
parent
24de843c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
persistent/tests/test_persistence.py
persistent/tests/test_persistence.py
+14
-1
No files found.
persistent/tests/test_persistence.py
View file @
1462ee2c
...
...
@@ -86,6 +86,11 @@ class _Persistent_Base(object):
self
.
assertEqual
(
inst
.
_p_sticky
,
False
)
self
.
assertEqual
(
inst
.
_p_status
,
'unsaved'
)
def
test_del_jar_no_jar
(
self
):
inst
=
self
.
_makeOne
()
del
inst
.
_p_jar
# does not raise
self
.
assertEqual
(
inst
.
_p_jar
,
None
)
def
test_del_jar_while_in_cache
(
self
):
inst
,
_
,
OID
=
self
.
_makeOneWithJar
()
def
_test
():
...
...
@@ -139,6 +144,14 @@ class _Persistent_Base(object):
inst
.
_p_oid
=
OID2
self
.
assertEqual
(
inst
.
_p_oid
,
OID2
)
def
test_assign_p_oid_w_None_wo_jar
(
self
):
from
persistent.timestamp
import
_makeOctets
OID1
=
_makeOctets
(
'
\
x01
'
*
8
)
inst
=
self
.
_makeOne
()
inst
.
_p_oid
=
OID1
inst
.
_p_oid
=
None
self
.
assertEqual
(
inst
.
_p_oid
,
None
)
def
test_assign_p_oid_w_new_oid_w_jar
(
self
):
from
persistent.timestamp
import
_makeOctets
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
()
...
...
@@ -759,7 +772,7 @@ class _Persistent_Base(object):
def
test___getstate___derived_w_slots
(
self
):
class
Derived
(
self
.
_getTargetClass
()):
__slots__
=
(
'foo'
,
'_p_baz'
,
'_v_qux'
)
__slots__
=
(
'foo'
,
'
baz'
,
'
_p_baz'
,
'_v_qux'
)
inst
=
Derived
()
inst
.
foo
=
'bar'
inst
.
_p_baz
=
'bam'
...
...
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