forked from ObjectProfile/PythonBridge
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPBConnectionTest.class.st
More file actions
62 lines (55 loc) · 1.37 KB
/
PBConnectionTest.class.st
File metadata and controls
62 lines (55 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Class {
#name : #PBConnectionTest,
#superclass : #TestCase,
#instVars : [
'application',
'oldApplication'
],
#category : #'PythonBridge-Tests'
}
{ #category : #running }
PBConnectionTest >> setUp [
oldApplication := PBApplication uniqueInstance.
application := PBApplication new.
PBApplication uniqueInstance: application
]
{ #category : #running }
PBConnectionTest >> tearDown [
application stop.
PBApplication uniqueInstance: oldApplication
]
{ #category : #tests }
PBConnectionTest >> testNotRunning [
self deny: application isRunning
]
{ #category : #tests }
PBConnectionTest >> testSimpleExecution [
self deny: application isRunning.
application start.
application send:
(PBCommand new instructions:
(Array with: (P3GBinaryOperator new
left: 1;
right: 2;
operator: $+;
yourself))).
application stop.
(Delay forMilliseconds: 150) wait.
self should: [ application send:
(PBCommand new instructions:
(Array with: (P3GBinaryOperator new
left: 1;
right: 2;
operator: $+;
yourself))) ] raise: Error.
]
{ #category : #tests }
PBConnectionTest >> testStartStopProcess [
self deny: application isRunning.
application start.
self assert: application processHandler isRunning.
application stop.
(Delay forMilliseconds: 150) wait.
self deny: application isRunning.
self deny: application processHandler isRunning
]