Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
41f2c8b5
Commit
41f2c8b5
authored
Feb 09, 2018
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make universe comparing more consistent
parent
4e1d09c0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
universe.py
alphamind/data/engines/universe.py
+2
-1
test_universe.py
alphamind/tests/data/engines/test_universe.py
+5
-0
No files found.
alphamind/data/engines/universe.py
View file @
41f2c8b5
...
@@ -40,7 +40,8 @@ class Universe(object):
...
@@ -40,7 +40,8 @@ class Universe(object):
return
self
.
name
==
rhs
.
name
\
return
self
.
name
==
rhs
.
name
\
and
list_eq
(
self
.
base_universe
,
rhs
.
base_universe
)
\
and
list_eq
(
self
.
base_universe
,
rhs
.
base_universe
)
\
and
list_eq
(
self
.
exclude_universe
,
rhs
.
exclude_universe
)
\
and
list_eq
(
self
.
exclude_universe
,
rhs
.
exclude_universe
)
\
and
list_eq
(
self
.
special_codes
,
rhs
.
special_codes
)
and
list_eq
(
self
.
special_codes
,
rhs
.
special_codes
)
\
and
str
(
self
.
filter_cond
)
==
str
(
rhs
.
filter_cond
)
@
property
@
property
def
is_filtered
(
self
):
def
is_filtered
(
self
):
...
...
alphamind/tests/data/engines/test_universe.py
View file @
41f2c8b5
...
@@ -26,6 +26,10 @@ class TestUniverse(unittest.TestCase):
...
@@ -26,6 +26,10 @@ class TestUniverse(unittest.TestCase):
universe2
=
Universe
(
'custom'
,
[
'zz500'
],
filter_cond
=
filter_cond
)
universe2
=
Universe
(
'custom'
,
[
'zz500'
],
filter_cond
=
filter_cond
)
self
.
assertEqual
(
universe1
,
universe2
)
self
.
assertEqual
(
universe1
,
universe2
)
universe1
=
Universe
(
'custom'
,
[
'zz500'
],
filter_cond
=
LAST
(
'x'
)
>
1.
)
universe2
=
Universe
(
'custom'
,
[
'zz500'
],
filter_cond
=
LAST
(
'x'
)
>
2.
)
self
.
assertNotEqual
(
universe1
,
universe2
)
def
test_universe_persistence
(
self
):
def
test_universe_persistence
(
self
):
universe
=
Universe
(
'custom'
,
[
'zz500'
])
universe
=
Universe
(
'custom'
,
[
'zz500'
])
univ_desc
=
universe
.
save
()
univ_desc
=
universe
.
save
()
...
@@ -40,3 +44,4 @@ class TestUniverse(unittest.TestCase):
...
@@ -40,3 +44,4 @@ class TestUniverse(unittest.TestCase):
self
.
assertEqual
(
universe
.
name
,
loaded_universe
.
name
)
self
.
assertEqual
(
universe
.
name
,
loaded_universe
.
name
)
self
.
assertListEqual
(
universe
.
base_universe
,
loaded_universe
.
base_universe
)
self
.
assertListEqual
(
universe
.
base_universe
,
loaded_universe
.
base_universe
)
self
.
assertEqual
(
str
(
universe
.
filter_cond
),
str
(
loaded_universe
.
filter_cond
))
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