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
c488b940
Commit
c488b940
authored
Jun 29, 2012
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence Py3k unittest nannyisms.
parent
a5dc7b7a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
62 deletions
+62
-62
persistent/tests/testPersistent.py
persistent/tests/testPersistent.py
+3
-3
persistent/tests/test_list.py
persistent/tests/test_list.py
+10
-10
persistent/tests/test_mapping.py
persistent/tests/test_mapping.py
+11
-11
persistent/tests/test_persistence.py
persistent/tests/test_persistence.py
+14
-14
persistent/tests/test_picklecache.py
persistent/tests/test_picklecache.py
+23
-23
persistent/tests/test_timestamp.py
persistent/tests/test_timestamp.py
+1
-1
No files found.
persistent/tests/testPersistent.py
View file @
c488b940
...
...
@@ -73,7 +73,7 @@ class PersistenceTest(unittest.TestCase):
self
.
assertEqual
(
obj
.
_p_changed
,
1
)
self
.
assertEqual
(
obj
.
_p_state
,
CHANGED
)
self
.
assert
_
(
obj
in
jar
.
registered
)
self
.
assert
True
(
obj
in
jar
.
registered
)
def
test_setattr_then_mark_uptodate
(
self
):
from
persistent
import
UPTODATE
...
...
@@ -97,7 +97,7 @@ class PersistenceTest(unittest.TestCase):
self
.
assertEqual
(
obj
.
_p_changed
,
1
)
self
.
assertEqual
(
obj
.
_p_state
,
CHANGED
)
self
.
assert
_
(
obj
in
jar
.
registered
)
self
.
assert
True
(
obj
in
jar
.
registered
)
def
test_cant_ghostify_if_changed
(
self
):
from
persistent
import
CHANGED
...
...
@@ -225,7 +225,7 @@ class PersistenceTest(unittest.TestCase):
obj
.
_p_serial
=
ts
.
raw
()
self
.
assertEqual
(
obj
.
_p_mtime
,
ts
.
timeTime
())
self
.
assert
_
(
isinstance
(
obj
.
_p_mtime
,
float
))
self
.
assert
True
(
isinstance
(
obj
.
_p_mtime
,
float
))
def
test_pickle_unpickle
(
self
):
import
pickle
...
...
persistent/tests/test_list.py
View file @
c488b940
...
...
@@ -40,8 +40,8 @@ class TestPList(unittest.TestCase):
m
.
foo
=
'bar'
m
.
_v_baz
=
'qux'
state
=
m
.
__getstate__
()
self
.
failUnless
(
'foo'
in
state
)
self
.
failIf
(
'_v_baz'
in
state
)
self
.
assertTrue
(
'foo'
in
state
)
self
.
assertFalse
(
'_v_baz'
in
state
)
def
testTheWorld
(
self
):
from
persistent._compat
import
PYTHON2
...
...
@@ -136,9 +136,9 @@ class TestPList(unittest.TestCase):
# Test __contains__
for
i
in
u2
:
self
.
failUnless
(
i
in
u2
,
"i in u2"
)
self
.
assertTrue
(
i
in
u2
,
"i in u2"
)
for
i
in
min
(
u2
)
-
1
,
max
(
u2
)
+
1
:
self
.
failUnless
(
i
not
in
u2
,
"i not in u2"
)
self
.
assertTrue
(
i
not
in
u2
,
"i not in u2"
)
# Test __delslice__
...
...
@@ -154,12 +154,12 @@ class TestPList(unittest.TestCase):
# Test __add__, __radd__, __mul__ and __rmul__
#self.
failUnless
(u1 + [] == [] + u1 == u1, "u1 + [] == [] + u1 == u1")
self
.
failUnless
(
u1
+
[
1
]
==
u2
,
"u1 + [1] == u2"
)
#self.
failUnless
([-1] + u1 == [-1, 0], "[-1] + u1 == [-1, 0]")
self
.
failUnless
(
u2
==
u2
*
1
==
1
*
u2
,
"u2 == u2*1 == 1*u2"
)
self
.
failUnless
(
u2
+
u2
==
u2
*
2
==
2
*
u2
,
"u2+u2 == u2*2 == 2*u2"
)
self
.
failUnless
(
u2
+
u2
+
u2
==
u2
*
3
==
3
*
u2
,
"u2+u2+u2 == u2*3 == 3*u2"
)
#self.
assertTrue
(u1 + [] == [] + u1 == u1, "u1 + [] == [] + u1 == u1")
self
.
assertTrue
(
u1
+
[
1
]
==
u2
,
"u1 + [1] == u2"
)
#self.
assertTrue
([-1] + u1 == [-1, 0], "[-1] + u1 == [-1, 0]")
self
.
assertTrue
(
u2
==
u2
*
1
==
1
*
u2
,
"u2 == u2*1 == 1*u2"
)
self
.
assertTrue
(
u2
+
u2
==
u2
*
2
==
2
*
u2
,
"u2+u2 == u2*2 == 2*u2"
)
self
.
assertTrue
(
u2
+
u2
+
u2
==
u2
*
3
==
3
*
u2
,
"u2+u2+u2 == u2*3 == 3*u2"
)
# Test append
...
...
persistent/tests/test_mapping.py
View file @
c488b940
...
...
@@ -63,8 +63,8 @@ class PersistentMappingTests(unittest.TestCase):
m
.
foo
=
'bar'
m
.
_v_baz
=
'qux'
state
=
m
.
__getstate__
()
self
.
failUnless
(
'foo'
in
state
)
self
.
failIf
(
'_v_baz'
in
state
)
self
.
assertTrue
(
'foo'
in
state
)
self
.
assertFalse
(
'_v_baz'
in
state
)
def
testTheWorld
(
self
):
from
persistent._compat
import
PYTHON2
...
...
@@ -145,9 +145,9 @@ class PersistentMappingTests(unittest.TestCase):
# Test __contains__
for
i
in
u2
:
self
.
failUnless
(
i
in
u2
,
"i in u2"
)
self
.
assertTrue
(
i
in
u2
,
"i in u2"
)
for
i
in
min
(
u2
)
-
1
,
max
(
u2
)
+
1
:
self
.
failUnless
(
i
not
in
u2
,
"i not in u2"
)
self
.
assertTrue
(
i
not
in
u2
,
"i not in u2"
)
# Test update
...
...
@@ -155,11 +155,11 @@ class PersistentMappingTests(unittest.TestCase):
u
=
self
.
_makeOne
(
l
)
u
.
update
(
u2
)
for
i
in
u
:
self
.
failUnless
(
i
in
l
or
i
in
u2
,
"i in l or i in u2"
)
self
.
assertTrue
(
i
in
l
or
i
in
u2
,
"i in l or i in u2"
)
for
i
in
l
:
self
.
failUnless
(
i
in
u
,
"i in u"
)
self
.
assertTrue
(
i
in
u
,
"i in u"
)
for
i
in
u2
:
self
.
failUnless
(
i
in
u
,
"i in u"
)
self
.
assertTrue
(
i
in
u
,
"i in u"
)
# Test setdefault
...
...
@@ -168,13 +168,13 @@ class PersistentMappingTests(unittest.TestCase):
x
=
u2
.
setdefault
(
5
,
5
)
eq
(
x
,
5
,
"u2.setdefault(5, 5) == 5"
)
self
.
failUnless
(
5
in
u2
,
"5 in u2"
)
self
.
assertTrue
(
5
in
u2
,
"5 in u2"
)
# Test pop
x
=
u2
.
pop
(
1
)
eq
(
x
,
1
,
"u2.pop(1) == 1"
)
self
.
failUnless
(
1
not
in
u2
,
"1 not in u2"
)
self
.
assertTrue
(
1
not
in
u2
,
"1 not in u2"
)
try
:
u2
.
pop
(
1
)
...
...
@@ -190,8 +190,8 @@ class PersistentMappingTests(unittest.TestCase):
items
=
list
(
u2
.
items
())
key
,
value
=
u2
.
popitem
()
self
.
failUnless
((
key
,
value
)
in
items
,
"key, value in items"
)
self
.
failUnless
(
key
not
in
u2
,
"key not in u2"
)
self
.
assertTrue
((
key
,
value
)
in
items
,
"key, value in items"
)
self
.
assertTrue
(
key
not
in
u2
,
"key not in u2"
)
# Test clear
...
...
persistent/tests/test_persistence.py
View file @
c488b940
...
...
@@ -79,7 +79,7 @@ class _Persistent_Base(object):
inst
=
self
.
_makeOne
()
inst
.
_p_jar
=
jar
self
.
assertEqual
(
inst
.
_p_status
,
'saved'
)
self
.
failUnless
(
inst
.
_p_jar
is
jar
)
self
.
assertTrue
(
inst
.
_p_jar
is
jar
)
inst
.
_p_jar
=
jar
# reassign only to same DM
def
test_assign_p_oid_w_invalid_oid
(
self
):
...
...
@@ -370,14 +370,14 @@ class _Persistent_Base(object):
inst
.
_p_activate
()
# XXX
inst
.
_p_changed
=
False
inst
.
_p_sticky
=
True
self
.
failUnless
(
inst
.
_p_sticky
)
self
.
assertTrue
(
inst
.
_p_sticky
)
def
test_assign_p_sticky_false_non_ghost
(
self
):
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
()
inst
.
_p_activate
()
# XXX
inst
.
_p_changed
=
False
inst
.
_p_sticky
=
False
self
.
failIf
(
inst
.
_p_sticky
)
self
.
assertFalse
(
inst
.
_p_sticky
)
def
test__p_status_unsaved
(
self
):
inst
=
self
.
_makeOne
()
...
...
@@ -784,7 +784,7 @@ class _Persistent_Base(object):
from
persistent._compat
import
copy_reg
inst
=
self
.
_makeOne
()
first
,
second
,
third
=
inst
.
__reduce__
()
self
.
failUnless
(
first
is
copy_reg
.
__newobj__
)
self
.
assertTrue
(
first
is
copy_reg
.
__newobj__
)
self
.
assertEqual
(
second
,
(
self
.
_getTargetClass
(),))
self
.
assertEqual
(
third
,
None
)
...
...
@@ -795,7 +795,7 @@ class _Persistent_Base(object):
return
(
'a'
,
'b'
)
inst
=
Derived
()
first
,
second
,
third
=
inst
.
__reduce__
()
self
.
failUnless
(
first
is
copy_reg
.
__newobj__
)
self
.
assertTrue
(
first
is
copy_reg
.
__newobj__
)
self
.
assertEqual
(
second
,
(
Derived
,
'a'
,
'b'
))
self
.
assertEqual
(
third
,
{})
...
...
@@ -806,7 +806,7 @@ class _Persistent_Base(object):
return
{}
inst
=
Derived
()
first
,
second
,
third
=
inst
.
__reduce__
()
self
.
failUnless
(
first
is
copy_reg
.
__newobj__
)
self
.
assertTrue
(
first
is
copy_reg
.
__newobj__
)
self
.
assertEqual
(
second
,
(
Derived
,))
self
.
assertEqual
(
third
,
{})
...
...
@@ -819,7 +819,7 @@ class _Persistent_Base(object):
return
{
'foo'
:
'bar'
}
inst
=
Derived
()
first
,
second
,
third
=
inst
.
__reduce__
()
self
.
failUnless
(
first
is
copy_reg
.
__newobj__
)
self
.
assertTrue
(
first
is
copy_reg
.
__newobj__
)
self
.
assertEqual
(
second
,
(
Derived
,
'a'
,
'b'
))
self
.
assertEqual
(
third
,
{
'foo'
:
'bar'
})
...
...
@@ -1104,7 +1104,7 @@ class _Persistent_Base(object):
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
()
inst
.
_p_deactivate
()
for
name
in
NAMES
:
self
.
failUnless
(
inst
.
_p_getattr
(
name
))
self
.
assertTrue
(
inst
.
_p_getattr
(
name
))
self
.
assertEqual
(
inst
.
_p_status
,
'ghost'
)
self
.
assertEqual
(
list
(
jar
.
_loaded
),
[])
self
.
_checkMRU
(
jar
,
[])
...
...
@@ -1114,7 +1114,7 @@ class _Persistent_Base(object):
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
()
inst
.
_p_deactivate
()
for
name
in
SPECIAL_NAMES
:
self
.
failUnless
(
inst
.
_p_getattr
(
name
))
self
.
assertTrue
(
inst
.
_p_getattr
(
name
))
self
.
assertEqual
(
inst
.
_p_status
,
'ghost'
)
self
.
assertEqual
(
list
(
jar
.
_loaded
),
[])
self
.
_checkMRU
(
jar
,
[])
...
...
@@ -1122,7 +1122,7 @@ class _Persistent_Base(object):
def
test__p_getattr_w_normal_name
(
self
):
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
()
inst
.
_p_deactivate
()
self
.
failIf
(
inst
.
_p_getattr
(
'normal'
))
self
.
assertFalse
(
inst
.
_p_getattr
(
'normal'
))
self
.
assertEqual
(
inst
.
_p_status
,
'saved'
)
self
.
assertEqual
(
list
(
jar
.
_loaded
),
[
OID
])
self
.
_checkMRU
(
jar
,
[
OID
])
...
...
@@ -1132,7 +1132,7 @@ class _Persistent_Base(object):
SERIAL
=
_makeOctets
(
'
\
x01
'
*
8
)
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
()
inst
.
_p_deactivate
()
self
.
failUnless
(
inst
.
_p_setattr
(
'_p_serial'
,
SERIAL
))
self
.
assertTrue
(
inst
.
_p_setattr
(
'_p_serial'
,
SERIAL
))
self
.
assertEqual
(
inst
.
_p_status
,
'ghost'
)
self
.
assertEqual
(
inst
.
_p_serial
,
SERIAL
)
self
.
assertEqual
(
list
(
jar
.
_loaded
),
[])
...
...
@@ -1141,7 +1141,7 @@ class _Persistent_Base(object):
def
test__p_setattr_w_normal_name
(
self
):
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
()
inst
.
_p_deactivate
()
self
.
failIf
(
inst
.
_p_setattr
(
'normal'
,
'value'
))
self
.
assertFalse
(
inst
.
_p_setattr
(
'normal'
,
'value'
))
# _p_setattr doesn't do the actual write for normal names
self
.
assertEqual
(
inst
.
_p_status
,
'saved'
)
self
.
assertEqual
(
list
(
jar
.
_loaded
),
[
OID
])
...
...
@@ -1155,7 +1155,7 @@ class _Persistent_Base(object):
inst
.
_p_changed
=
True
jar
.
_loaded
=
[]
for
name
in
NAMES
:
self
.
failUnless
(
inst
.
_p_delattr
(
name
))
self
.
assertTrue
(
inst
.
_p_delattr
(
name
))
self
.
assertEqual
(
inst
.
_p_status
,
'ghost'
)
self
.
assertEqual
(
inst
.
_p_changed
,
None
)
self
.
assertEqual
(
list
(
jar
.
_loaded
),
[])
...
...
@@ -1166,7 +1166,7 @@ class _Persistent_Base(object):
normal
=
'value'
inst
,
jar
,
OID
=
self
.
_makeOneWithJar
(
Derived
)
inst
.
_p_deactivate
()
self
.
failIf
(
inst
.
_p_delattr
(
'normal'
))
self
.
assertFalse
(
inst
.
_p_delattr
(
'normal'
))
# _p_delattr doesn't do the actual delete for normal names
self
.
assertEqual
(
inst
.
_p_status
,
'saved'
)
self
.
assertEqual
(
list
(
jar
.
_loaded
),
[
OID
])
...
...
persistent/tests/test_picklecache.py
View file @
c488b940
...
...
@@ -77,7 +77,7 @@ class PickleCacheTests(unittest.TestCase):
cache
=
self
.
_makeOne
()
default
=
object
self
.
failUnless
(
cache
.
get
(
'nonesuch'
,
default
)
is
default
)
self
.
assertTrue
(
cache
.
get
(
'nonesuch'
,
default
)
is
default
)
def
test___setitem___non_string_oid_raises_ValueError
(
self
):
cache
=
self
.
_makeOne
()
...
...
@@ -119,8 +119,8 @@ class PickleCacheTests(unittest.TestCase):
self
.
assertEqual
(
_len
(
cache
.
klass_items
()),
0
)
self
.
assertEqual
(
items
[
0
][
0
],
KEY
)
self
.
assertEqual
(
cache
.
ringlen
(),
0
)
self
.
failUnless
(
items
[
0
][
1
]
is
ghost
)
self
.
failUnless
(
cache
[
KEY
]
is
ghost
)
self
.
assertTrue
(
items
[
0
][
1
]
is
ghost
)
self
.
assertTrue
(
cache
[
KEY
]
is
ghost
)
def
test___setitem___non_ghost
(
self
):
from
persistent.interfaces
import
UPTODATE
...
...
@@ -137,9 +137,9 @@ class PickleCacheTests(unittest.TestCase):
self
.
assertEqual
(
_len
(
cache
.
klass_items
()),
0
)
self
.
assertEqual
(
items
[
0
][
0
],
KEY
)
self
.
assertEqual
(
cache
.
ringlen
(),
1
)
self
.
failUnless
(
items
[
0
][
1
]
is
uptodate
)
self
.
failUnless
(
cache
[
KEY
]
is
uptodate
)
self
.
failUnless
(
cache
.
get
(
KEY
)
is
uptodate
)
self
.
assertTrue
(
items
[
0
][
1
]
is
uptodate
)
self
.
assertTrue
(
cache
[
KEY
]
is
uptodate
)
self
.
assertTrue
(
cache
.
get
(
KEY
)
is
uptodate
)
def
test___setitem___persistent_class
(
self
):
from
persistent._compat
import
_b
...
...
@@ -155,9 +155,9 @@ class PickleCacheTests(unittest.TestCase):
self
.
assertEqual
(
_len
(
cache
.
items
()),
0
)
self
.
assertEqual
(
len
(
kitems
),
1
)
self
.
assertEqual
(
kitems
[
0
][
0
],
KEY
)
self
.
failUnless
(
kitems
[
0
][
1
]
is
pclass
)
self
.
failUnless
(
cache
[
KEY
]
is
pclass
)
self
.
failUnless
(
cache
.
get
(
KEY
)
is
pclass
)
self
.
assertTrue
(
kitems
[
0
][
1
]
is
pclass
)
self
.
assertTrue
(
cache
[
KEY
]
is
pclass
)
self
.
assertTrue
(
cache
.
get
(
KEY
)
is
pclass
)
def
test___delitem___non_string_oid_raises_ValueError
(
self
):
cache
=
self
.
_makeOne
()
...
...
@@ -389,10 +389,10 @@ class PickleCacheTests(unittest.TestCase):
self
.
assertEqual
(
items
[
9
][
0
],
_b
(
'oid_0099'
))
for
oid
in
oids
[:
90
]:
self
.
failUnless
(
cache
.
get
(
oid
)
is
None
)
self
.
assertTrue
(
cache
.
get
(
oid
)
is
None
)
for
oid
in
oids
[
90
:]:
self
.
failIf
(
cache
.
get
(
oid
)
is
None
)
self
.
assertFalse
(
cache
.
get
(
oid
)
is
None
)
def
test_incrgc_w_smaller_drain_resistance
(
self
):
from
persistent.interfaces
import
UPTODATE
...
...
@@ -443,10 +443,10 @@ class PickleCacheTests(unittest.TestCase):
gc
.
collect
()
# banish the ghosts who are no longer in the ring
self
.
assertEqual
(
cache
.
cache_non_ghost_count
,
0
)
self
.
failUnless
(
cache
.
ring
.
next
is
cache
.
ring
)
self
.
assertTrue
(
cache
.
ring
.
next
is
cache
.
ring
)
for
oid
in
oids
:
self
.
failUnless
(
cache
.
get
(
oid
)
is
None
)
self
.
assertTrue
(
cache
.
get
(
oid
)
is
None
)
def
test_minimize
(
self
):
import
gc
...
...
@@ -466,7 +466,7 @@ class PickleCacheTests(unittest.TestCase):
self
.
assertEqual
(
cache
.
cache_non_ghost_count
,
0
)
for
oid
in
oids
:
self
.
failUnless
(
cache
.
get
(
oid
)
is
None
)
self
.
assertTrue
(
cache
.
get
(
oid
)
is
None
)
def
test_new_ghost_non_persistent_object
(
self
):
from
persistent._compat
import
_b
...
...
@@ -504,7 +504,7 @@ class PickleCacheTests(unittest.TestCase):
cache
=
self
.
_makeOne
()
candidate
=
self
.
_makePersist
(
oid
=
None
,
jar
=
None
)
cache
.
new_ghost
(
KEY
,
candidate
)
self
.
failUnless
(
cache
.
get
(
KEY
)
is
candidate
)
self
.
assertTrue
(
cache
.
get
(
KEY
)
is
candidate
)
self
.
assertEqual
(
candidate
.
_p_oid
,
KEY
)
self
.
assertEqual
(
candidate
.
_p_jar
,
cache
.
jar
)
self
.
assertEqual
(
candidate
.
_p_state
,
GHOST
)
...
...
@@ -517,7 +517,7 @@ class PickleCacheTests(unittest.TestCase):
cache
=
self
.
_makeOne
()
candidate
=
self
.
_makePersist
(
oid
=
None
,
jar
=
None
,
state
=
UPTODATE
)
cache
.
new_ghost
(
KEY
,
candidate
)
self
.
failUnless
(
cache
.
get
(
KEY
)
is
candidate
)
self
.
assertTrue
(
cache
.
get
(
KEY
)
is
candidate
)
self
.
assertEqual
(
candidate
.
_p_oid
,
KEY
)
self
.
assertEqual
(
candidate
.
_p_jar
,
cache
.
jar
)
self
.
assertEqual
(
candidate
.
_p_state
,
GHOST
)
...
...
@@ -530,8 +530,8 @@ class PickleCacheTests(unittest.TestCase):
_p_jar
=
None
cache
=
self
.
_makeOne
()
cache
.
new_ghost
(
KEY
,
Pclass
)
self
.
failUnless
(
cache
.
get
(
KEY
)
is
Pclass
)
self
.
failUnless
(
cache
.
persistent_classes
[
KEY
]
is
Pclass
)
self
.
assertTrue
(
cache
.
get
(
KEY
)
is
Pclass
)
self
.
assertTrue
(
cache
.
persistent_classes
[
KEY
]
is
Pclass
)
self
.
assertEqual
(
Pclass
.
_p_oid
,
KEY
)
self
.
assertEqual
(
Pclass
.
_p_jar
,
cache
.
jar
)
...
...
@@ -543,8 +543,8 @@ class PickleCacheTests(unittest.TestCase):
_p_jar
=
None
cache
=
self
.
_makeOne
()
cache
.
new_ghost
(
KEY
,
Pclass
)
self
.
failUnless
(
cache
.
get
(
KEY
)
is
Pclass
)
self
.
failUnless
(
cache
.
persistent_classes
[
KEY
]
is
Pclass
)
self
.
assertTrue
(
cache
.
get
(
KEY
)
is
Pclass
)
self
.
assertTrue
(
cache
.
persistent_classes
[
KEY
]
is
Pclass
)
self
.
assertEqual
(
Pclass
.
_p_oid
,
KEY
)
self
.
assertEqual
(
Pclass
.
_p_jar
,
cache
.
jar
)
...
...
@@ -574,7 +574,7 @@ class PickleCacheTests(unittest.TestCase):
self
.
assertEqual
(
cache
.
ringlen
(),
1
)
items
=
cache
.
lru_items
()
self
.
assertEqual
(
items
[
0
][
0
],
KEY
)
self
.
failUnless
(
items
[
0
][
1
]
is
candidate
)
self
.
assertTrue
(
items
[
0
][
1
]
is
candidate
)
self
.
assertEqual
(
candidate
.
_p_state
,
UPTODATE
)
def
test_reify_hit_single_non_ghost
(
self
):
...
...
@@ -669,9 +669,9 @@ class PickleCacheTests(unittest.TestCase):
_p_jar
=
None
cache
=
self
.
_makeOne
()
cache
[
KEY
]
=
Pclass
self
.
failUnless
(
cache
.
persistent_classes
[
KEY
]
is
Pclass
)
self
.
assertTrue
(
cache
.
persistent_classes
[
KEY
]
is
Pclass
)
cache
.
invalidate
(
KEY
)
self
.
failIf
(
KEY
in
cache
.
persistent_classes
)
self
.
assertFalse
(
KEY
in
cache
.
persistent_classes
)
def
test_debug_info_w_persistent_class
(
self
):
import
gc
...
...
persistent/tests/test_timestamp.py
View file @
c488b940
...
...
@@ -143,7 +143,7 @@ class pyTimeStampTests(unittest.TestCase):
ts1
=
self
.
_makeOne
(
SERIAL1
)
ts2
=
self
.
_makeOne
(
SERIAL2
)
later
=
ts2
.
laterThan
(
ts1
)
self
.
failUnless
(
later
is
ts2
)
self
.
assertTrue
(
later
is
ts2
)
def
test_repr
(
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