Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Yori Fournier
myplotlib
Commits
50fd4b3d
Commit
50fd4b3d
authored
Feb 07, 2018
by
Yori Fournier
Browse files
add some test for the new merged features (updateSyncFig and deleteSyncFig)
parent
35162722
Pipeline
#427
passed with stage
in 3 minutes and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/network/test_com.py
View file @
50fd4b3d
...
...
@@ -14,16 +14,10 @@ import clientside.myplotlib as mpl_client
server
=
mpl_server
.
MplServer2
(
port
=
12345
,
knownFunctions
=
SERVER_IOFUNCTIONS
,
knownFigures
=
SERVER_FIGURES
)
client
=
mpl_client
.
MplClient2
()
# Start a thread with the server -- that thread will then start one
# more thread for each request
# server_thread = threading.Thread(target=server.serve_forever)
# Exit the server thread when the main thread terminates
# server_thread.daemon = True
# server_thread.start()
server
.
run
()
print
"Server loop running in thread:"
,
server
.
server_thread
.
name
client
.
connect
((
'localhost'
,
12345
))
print
(
"Client is now connected"
)
client
.
readData
(
'readStupidData'
,
'data1'
)
fig1
=
client
.
newSyncFigure
(
FigTestc
,
(
'data1'
,))
...
...
test/network/test_com_nogl.py
View file @
50fd4b3d
...
...
@@ -10,18 +10,23 @@ SERVER_FIGURES = {'FigTest': FigTests}
import
serverside.myplotlib
as
mpl_server
import
clientside.myplotlib
as
mpl_client
server
=
mpl_server
.
MplServer2
(
port
=
50803
,
knownFunctions
=
SERVER_IOFUNCTIONS
,
knownFigures
=
SERVER_FIGURES
)
server
=
mpl_server
.
MplServer2
(
port
=
12345
,
knownFunctions
=
SERVER_IOFUNCTIONS
,
knownFigures
=
SERVER_FIGURES
)
client
=
mpl_client
.
MplClient2
()
# Start a thread with the server -- that thread will then start one
# more thread for each request
server_thread
=
threading
.
Thread
(
target
=
server
.
serve_forever
)
# Exit the server thread when the main thread terminates
server_thread
.
daemon
=
True
server_thread
.
start
()
print
"Server loop running in thread:"
,
server_thread
.
name
client
.
connect
((
''
,
50803
))
server
.
run
()
print
"Server loop running in thread:"
,
server
.
server_thread
.
name
client
.
connect
((
''
,
12345
))
print
(
"Client is now connected"
)
# create a figure
client
.
readData
(
'readStupidData'
,
'data1'
)
fig
=
client
.
newSyncFigure
(
FigTestc
,
(
'data1'
,))
fig1
=
client
.
newSyncFigure
(
FigTestc
,
(
'data1'
,))
# update test
fig1
.
update
(
xRange
=
[
-
2
,
2
],
yRange
=
[
-
2
,
2
])
# multiple figures
fig2
=
client
.
newSyncFigure
(
FigTestc
,
(
'data1'
,),
xRange
=
[
-
1.5
,
1.5
],
yRange
=
[
-
1.5
,
1.5
])
fig1
.
deSyncFig
()
fig2
.
deSyncFig
()
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