Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
95117c78
Commit
95117c78
authored
Mar 27, 2015
by
panos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A test inserted
parent
90b0e0a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
dream/tests/testKEExamples.py
dream/tests/testKEExamples.py
+21
-0
No files found.
dream/tests/testKEExamples.py
View file @
95117c78
...
...
@@ -45,4 +45,25 @@ class KnowledgeExtractionExamples(TestCase):
self
.
assertTrue
(
99.93
<
element
[
'results'
][
'working_ratio'
][
0
]
<
99.94
)
jsonFile
.
close
()
def
testTwoServers
(
self
):
from
dream.KnowledgeExtraction.KEtool_examples.TwoServers.TwoServers_example
import
main
filepath
=
os
.
path
.
join
(
project_path
,
"dream"
,
"KnowledgeExtraction"
,
"KEtool_examples"
,
"TwoServers"
)
workbook
=
xlrd
.
open_workbook
(
os
.
path
.
join
(
filepath
,
'inputsTwoServers.xls'
))
jsonFile
=
open
(
os
.
path
.
join
(
filepath
,
'JSON_TwoServers.json'
))
result
=
main
(
test
=
1
,
workbook
=
workbook
,
jsonFile
=
jsonFile
)
result_data
=
json
.
loads
(
result
)
result_data
=
result_data
[
'result'
][
'result_list'
][
0
]
elementList
=
result_data
.
get
(
'elementList'
,[])
for
element
in
elementList
:
if
element
[
'id'
]
==
'E1'
:
self
.
assertEquals
(
element
[
'results'
][
'throughput'
][
0
],
272
)
if
element
[
'id'
]
==
'M2'
:
self
.
assertTrue
(
13.05
<
element
[
'results'
][
'working_ratio'
][
0
]
<
13.06
)
if
element
[
'id'
]
==
'M1'
:
self
.
assertTrue
(
92.01
<
element
[
'results'
][
'working_ratio'
][
0
]
<
92.02
)
jsonFile
.
close
()
\ No newline at end of file
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