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
25b52694
Commit
25b52694
authored
Feb 23, 2017
by
Adam Groszer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix py3x tests
parent
30c6cd93
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
persistent/tests/test_persistence.py
persistent/tests/test_persistence.py
+5
-6
No files found.
persistent/tests/test_persistence.py
View file @
25b52694
...
@@ -985,14 +985,14 @@ class _Persistent_Base(object):
...
@@ -985,14 +985,14 @@ class _Persistent_Base(object):
key2
=
list
(
inst2
.
__dict__
.
keys
())[
0
]
key2
=
list
(
inst2
.
__dict__
.
keys
())[
0
]
self
.
assertTrue
(
key1
is
key2
)
self
.
assertTrue
(
key1
is
key2
)
import
UserDict
from
persistent._compat
import
Iterable
UserDict
inst1
=
Derived
()
inst1
=
Derived
()
inst2
=
Derived
()
inst2
=
Derived
()
key1
=
'key'
key1
=
'key'
key2
=
'ke'
;
key2
+=
'y'
# construct in a way that won't intern the literal
key2
=
'ke'
;
key2
+=
'y'
# construct in a way that won't intern the literal
self
.
assertFalse
(
key1
is
key2
)
self
.
assertFalse
(
key1
is
key2
)
state1
=
UserDict
.
IterableUserDict
({
key1
:
1
})
state1
=
IterableUserDict
({
key1
:
1
})
state2
=
UserDict
.
IterableUserDict
({
key2
:
2
})
state2
=
IterableUserDict
({
key2
:
2
})
k1
=
list
(
state1
.
keys
())[
0
]
k1
=
list
(
state1
.
keys
())[
0
]
k2
=
list
(
state2
.
keys
())[
0
]
k2
=
list
(
state2
.
keys
())[
0
]
self
.
assertFalse
(
k1
is
k2
)
# verify
self
.
assertFalse
(
k1
is
k2
)
# verify
...
@@ -1002,7 +1002,6 @@ class _Persistent_Base(object):
...
@@ -1002,7 +1002,6 @@ class _Persistent_Base(object):
key2
=
list
(
inst2
.
__dict__
.
keys
())[
0
]
key2
=
list
(
inst2
.
__dict__
.
keys
())[
0
]
self
.
assertTrue
(
key1
is
key2
)
self
.
assertTrue
(
key1
is
key2
)
def
test___setstate___doesnt_fail_on_non_string_keys
(
self
):
def
test___setstate___doesnt_fail_on_non_string_keys
(
self
):
class
Derived
(
self
.
_getTargetClass
()):
class
Derived
(
self
.
_getTargetClass
()):
pass
pass
...
@@ -1021,8 +1020,8 @@ class _Persistent_Base(object):
...
@@ -1021,8 +1020,8 @@ class _Persistent_Base(object):
pass
pass
inst1
=
Derived
()
inst1
=
Derived
()
import
UserDict
from
persistent._compat
import
Iterable
UserDict
state
=
UserDict
.
IterableUserDict
({
'foobar'
:
[
1
,
2
]})
state
=
IterableUserDict
({
'foobar'
:
[
1
,
2
]})
inst1
.
__setstate__
(
state
)
inst1
.
__setstate__
(
state
)
self
.
assertTrue
(
hasattr
(
inst1
,
'foobar'
))
self
.
assertTrue
(
hasattr
(
inst1
,
'foobar'
))
...
...
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