File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ import time
2
+ import unittest
3
+ import uuid
4
+ from simvue import Run , Client
5
+
6
+ import common
7
+
8
+ class TestRunEvents (unittest .TestCase ):
9
+ def test_run_events (self ):
10
+ """
11
+ Try logging events and retrieving them
12
+ """
13
+ name = 'test-%s' % str (uuid .uuid4 ())
14
+ run = Run ()
15
+ run .init (name , folder = common .FOLDER )
16
+
17
+ run .log_event ('test-event-1' , timestamp = '2022-01-03 16:42:30.849617' )
18
+ run .log_event ('test-event-2' , timestamp = '2022-01-03 16:42:31.849617' )
19
+
20
+ run .close ()
21
+
22
+ time .sleep (5 )
23
+
24
+ client = Client ()
25
+ data = client .get_events (name )
26
+
27
+ data_compare = [{'timestamp' : '2022-01-03 16:42:30.849617' , 'message' : 'test-event-1' },
28
+ {'timestamp' : '2022-01-03 16:42:31.849617' , 'message' : 'test-event-2' }]
29
+
30
+ self .assertEqual (data , data_compare )
31
+
32
+ runs = client .delete_runs (common .FOLDER )
33
+ self .assertEqual (len (runs ), 1 )
34
+
35
+ if __name__ == '__main__' :
36
+ unittest .main ()
You can’t perform that action at this time.
0 commit comments