Ticket #7972: test_copy_logs.py

File test_copy_logs.py, 2.3 KB (added by Karl Palmen, 7 years ago)
Line 
1# Test MergeReplaceExisting
2ws1 = CreateWorkspace(OutputWorkspace='SomeWorkspace',DataX='1',DataY='2',DataE='3',UnitX='Label',VerticalAxisUnit='Empty',VerticalAxisValues='0')
3ws2 = CreateWorkspace(OutputWorkspace='SomeOtherWorkspace',DataX='1',DataY='2',DataE='3',UnitX='Label',VerticalAxisUnit='Empty',VerticalAxisValues='0')
4
5#Add logs to first workspace
6AddSampleLog(Workspace='SomeWorkspace',LogName='A',LogText='Hello')
7AddSampleLog(Workspace='SomeWorkspace',LogName='B',LogText='World')
8AddSampleLog(Workspace='SomeWorkspace',LogName='D',LogText='Yeah!')
9
10#Add logs to second workspace
11AddSampleLog(Workspace='SomeOtherWorkspace',LogName='A',LogText='Hello')
12AddSampleLog(Workspace='SomeOtherWorkspace',LogName='B',LogText='Universe')
13AddSampleLog(Workspace='SomeOtherWorkspace',LogName='C',LogText='Today')
14
15CopyLogs(InputWorkspace=ws1, OutputWorkspace=ws2,MergeStrategy="MergeReplaceExisting")
16
17
18# Test WipeExisting
19ws4 = CreateWorkspace(OutputWorkspace='SomeOtherWorkspace2',DataX='1',DataY='2',DataE='3',UnitX='Label',VerticalAxisUnit='Empty',VerticalAxisValues='0')
20
21#Add logs to first workspace
22AddSampleLog(Workspace='SomeWorkspace',LogName='A',LogText='Hello')
23AddSampleLog(Workspace='SomeWorkspace',LogName='B',LogText='World')
24AddSampleLog(Workspace='SomeWorkspace',LogName='D',LogText='Yeah!')
25
26#Add logs to second workspace
27AddSampleLog(Workspace='SomeOtherWorkspace2',LogName='A',LogText='Hello')
28AddSampleLog(Workspace='SomeOtherWorkspace2',LogName='B',LogText='Universe')
29AddSampleLog(Workspace='SomeOtherWorkspace2',LogName='C',LogText='Today')
30
31CopyLogs(InputWorkspace=ws1, OutputWorkspace=ws4,MergeStrategy="WipeExisting")
32
33
34# Test MergeKeepExisting
35ws6 = CreateWorkspace(OutputWorkspace='SomeOtherWorkspace3',DataX='1',DataY='2',DataE='3',UnitX='Label',VerticalAxisUnit='Empty',VerticalAxisValues='0')
36
37#Add logs to first workspace
38AddSampleLog(Workspace='SomeWorkspace',LogName='A',LogText='Hello')
39AddSampleLog(Workspace='SomeWorkspace',LogName='B',LogText='World')
40AddSampleLog(Workspace='SomeWorkspace',LogName='D',LogText='Yeah!')
41
42#Add logs to second workspace
43AddSampleLog(Workspace='SomeOtherWorkspace3',LogName='A',LogText='Hello')
44AddSampleLog(Workspace='SomeOtherWorkspace3',LogName='B',LogText='Universe')
45AddSampleLog(Workspace='SomeOtherWorkspace3',LogName='C',LogText='Today')
46
47CopyLogs(InputWorkspace=ws1, OutputWorkspace=ws6,MergeStrategy="MergeKeepExisting")