File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ import shutil
2
+ import unittest
3
+ import uuid
4
+ from simvue import Run , Client
5
+ from simvue .sender import sender
6
+
7
+ import common
8
+
9
+ class TestRunCreated (unittest .TestCase ):
10
+ def test_basic_run (self ):
11
+ """
12
+ Create a run in the created state, then reconnect to it
13
+ """
14
+ common .update_config ()
15
+ try :
16
+ shutil .rmtree ('./offline' )
17
+ except :
18
+ pass
19
+
20
+ name = 'test-%s' % str (uuid .uuid4 ())
21
+ run_create = Run ('offline' )
22
+ run_create .init (name , folder = common .FOLDER , running = False )
23
+ uid = run_create .uid
24
+
25
+ self .assertEqual (name , run_create .name )
26
+
27
+ sender ()
28
+
29
+ client = Client ()
30
+ data = client .get_run (name )
31
+
32
+ self .assertEqual (data ['status' ], 'created' )
33
+
34
+ run_start = Run ('offline' )
35
+ run_start .reconnect (name , uid )
36
+
37
+ sender ()
38
+
39
+ data = client .get_run (name )
40
+ self .assertEqual (data ['status' ], 'running' )
41
+
42
+ run_start .close ()
43
+
44
+ if __name__ == '__main__' :
45
+ unittest .main ()
You can’t perform that action at this time.
0 commit comments