processview 0.1.2__tar.gz → 0.1.2b1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/__pycache__/version.cpython-37.pyc +0 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/core/manager/test/__pycache__/test_manager.cpython-37.pyc +0 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/core/manager/test/test_manager.py +2 -21
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/test/__init__.py +0 -2
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/test/__pycache__/__init__.cpython-37.pyc +0 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/version.py +1 -1
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.2-py3.7.egg-info → processview-0.1.2b1-py3.7.egg-info}/PKG-INFO +1 -1
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.2-py3.7.egg-info → processview-0.1.2b1-py3.7.egg-info}/SOURCES.txt +0 -2
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/test/__init__.py +0 -38
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/test/__pycache__/__init__.cpython-37.pyc +0 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/test/__pycache__/test_process_manager.cpython-37.pyc +0 -0
- home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/processview/gui/test/test_process_manager.py +0 -108
- /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.2-py3.7.egg-info → processview-0.1.2b1-py3.7.egg-info}/dependency_links.txt +0 -0
- /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.2-py3.7.egg-info → processview-0.1.2b1-py3.7.egg-info}/not-zip-safe +0 -0
- /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.2-py3.7.egg-info → processview-0.1.2b1-py3.7.egg-info}/requires.txt +0 -0
- /home/payno/.local/share/virtualenvs/tomwer_venv/lib/python3.7/site-packages/{processview-0.1.2-py3.7.egg-info → processview-0.1.2b1-py3.7.egg-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -33,7 +33,6 @@ from processview.core.superviseprocess import SuperviseProcess
|
|
|
33
33
|
from processview.core.manager import ProcessManager
|
|
34
34
|
from processview.core.manager import DatasetState
|
|
35
35
|
from processview.core.dataset import Dataset
|
|
36
|
-
from processview.core.dataset import DatasetIdentifier
|
|
37
36
|
import gc
|
|
38
37
|
|
|
39
38
|
|
|
@@ -100,10 +99,7 @@ class TestProcessManager(unittest.TestCase):
|
|
|
100
99
|
# test 'getProcessHistory'
|
|
101
100
|
self.assertEqual(
|
|
102
101
|
manager.get_process_history(process=p1),
|
|
103
|
-
(
|
|
104
|
-
(scan_1.get_dataset_identifier(), DatasetState.PENDING),
|
|
105
|
-
(scan_2.get_dataset_identifier(), DatasetState.SUCCEED),
|
|
106
|
-
),
|
|
102
|
+
((str(scan_1), DatasetState.PENDING), (str(scan_2), DatasetState.SUCCEED)),
|
|
107
103
|
)
|
|
108
104
|
|
|
109
105
|
|
|
@@ -115,24 +111,9 @@ class _DummyScan(Dataset):
|
|
|
115
111
|
def __str__(self) -> str:
|
|
116
112
|
return self.name
|
|
117
113
|
|
|
118
|
-
def
|
|
119
|
-
return _DummyIdentifier(self)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
class _DummyIdentifier(DatasetIdentifier):
|
|
123
|
-
def __init__(self, dataset):
|
|
124
|
-
super().__init__(dataset)
|
|
125
|
-
self.name = dataset.name
|
|
126
|
-
|
|
127
|
-
def __str__(self):
|
|
114
|
+
def short_str(self):
|
|
128
115
|
return self.name
|
|
129
116
|
|
|
130
|
-
def __eq__(self, other):
|
|
131
|
-
return self.name == other.name
|
|
132
|
-
|
|
133
|
-
def __hash__(self):
|
|
134
|
-
return hash(self.name)
|
|
135
|
-
|
|
136
117
|
|
|
137
118
|
def suite():
|
|
138
119
|
test_suite = unittest.TestSuite()
|
|
@@ -30,13 +30,11 @@ __date__ = "29/01/2021"
|
|
|
30
30
|
|
|
31
31
|
import unittest
|
|
32
32
|
from ..core import test as test_core
|
|
33
|
-
from ..gui import test as test_gui
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
def suite(loader=None):
|
|
37
36
|
test_suite = unittest.TestSuite()
|
|
38
37
|
test_suite.addTest(test_core.suite())
|
|
39
|
-
test_suite.addTest(test_gui.suite())
|
|
40
38
|
|
|
41
39
|
return test_suite
|
|
42
40
|
|
|
Binary file
|
|
@@ -21,8 +21,6 @@ processview/core/test/__init__.py
|
|
|
21
21
|
processview/gui/__init__.py
|
|
22
22
|
processview/gui/icons.py
|
|
23
23
|
processview/gui/processmanager.py
|
|
24
|
-
processview/gui/test/__init__.py
|
|
25
|
-
processview/gui/test/test_process_manager.py
|
|
26
24
|
processview/resources/__init__.py
|
|
27
25
|
processview/resources/gui/icons/advancement.png
|
|
28
26
|
processview/resources/gui/icons/advancement.svg
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
# /*##########################################################################
|
|
3
|
-
#
|
|
4
|
-
# Copyright (c) 2017 European Synchrotron Radiation Facility
|
|
5
|
-
#
|
|
6
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
# in the Software without restriction, including without limitation the rights
|
|
9
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
# furnished to do so, subject to the following conditions:
|
|
12
|
-
#
|
|
13
|
-
# The above copyright notice and this permission notice shall be included in
|
|
14
|
-
# all copies or substantial portions of the Software.
|
|
15
|
-
#
|
|
16
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
-
# THE SOFTWARE.
|
|
23
|
-
#
|
|
24
|
-
# ###########################################################################*/
|
|
25
|
-
|
|
26
|
-
__authors__ = ["H.Payno"]
|
|
27
|
-
__license__ = "MIT"
|
|
28
|
-
__date__ = "01/02/2021"
|
|
29
|
-
|
|
30
|
-
import unittest
|
|
31
|
-
|
|
32
|
-
from .test_process_manager import suite as test_process_manager_suite
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def suite():
|
|
36
|
-
test_suite = unittest.TestSuite()
|
|
37
|
-
test_suite.addTest(test_process_manager_suite())
|
|
38
|
-
return test_suite
|
|
Binary file
|
|
Binary file
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
# /*##########################################################################
|
|
3
|
-
#
|
|
4
|
-
# Copyright (c) 2016-2017 European Synchrotron Radiation Facility
|
|
5
|
-
#
|
|
6
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
# in the Software without restriction, including without limitation the rights
|
|
9
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
# furnished to do so, subject to the following conditions:
|
|
12
|
-
#
|
|
13
|
-
# The above copyright notice and this permission notice shall be included in
|
|
14
|
-
# all copies or substantial portions of the Software.
|
|
15
|
-
#
|
|
16
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
-
# THE SOFTWARE.
|
|
23
|
-
#
|
|
24
|
-
# ###########################################################################*/
|
|
25
|
-
|
|
26
|
-
__authors__ = ["H. Payno"]
|
|
27
|
-
__license__ = "MIT"
|
|
28
|
-
__date__ = "02/11/2020"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import unittest
|
|
32
|
-
from processview.core.superviseprocess import SuperviseProcess
|
|
33
|
-
from processview.core.dataset import Dataset
|
|
34
|
-
from processview.core.dataset import DatasetIdentifier
|
|
35
|
-
from processview.gui.processmanager import ProcessManager
|
|
36
|
-
from processview.core.manager import DatasetState
|
|
37
|
-
from silx.gui.utils.testutils import SignalListener
|
|
38
|
-
from silx.gui.utils.testutils import TestCaseQt
|
|
39
|
-
import gc
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
class TestProcessManager(TestCaseQt):
|
|
43
|
-
"""
|
|
44
|
-
test ProcessManager
|
|
45
|
-
"""
|
|
46
|
-
|
|
47
|
-
def setUp(self):
|
|
48
|
-
TestCaseQt.setUp(self)
|
|
49
|
-
self.signalListener = SignalListener()
|
|
50
|
-
self.manager = ProcessManager()
|
|
51
|
-
self.manager.sigUpdated.connect(self.signalListener)
|
|
52
|
-
|
|
53
|
-
def tearDown(self):
|
|
54
|
-
self.signalListener = None
|
|
55
|
-
self.processManager = None
|
|
56
|
-
gc.collect()
|
|
57
|
-
TestCaseQt.tearDown(self)
|
|
58
|
-
|
|
59
|
-
def testProcessStatesUpdate(self):
|
|
60
|
-
"""insure providing states works well"""
|
|
61
|
-
p1 = SuperviseProcess()
|
|
62
|
-
p2 = SuperviseProcess()
|
|
63
|
-
scan_1 = _DummyScan("scan1")
|
|
64
|
-
scan_2 = _DummyScan("scan2")
|
|
65
|
-
self.manager.notify_dataset_state(
|
|
66
|
-
dataset=scan_1, state=DatasetState.PENDING, process=p1
|
|
67
|
-
)
|
|
68
|
-
self.manager.notify_dataset_state(
|
|
69
|
-
dataset=scan_2, state=DatasetState.SUCCEED, process=p1
|
|
70
|
-
)
|
|
71
|
-
self.manager.notify_dataset_state(
|
|
72
|
-
dataset=scan_2, state=DatasetState.FAILED, process=p2
|
|
73
|
-
)
|
|
74
|
-
self.assertEqual(self.signalListener.callCount(), 3)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class _DummyScan(Dataset):
|
|
78
|
-
def __init__(self, name):
|
|
79
|
-
super().__init__()
|
|
80
|
-
self.name = name
|
|
81
|
-
|
|
82
|
-
def __str__(self) -> str:
|
|
83
|
-
return self.name
|
|
84
|
-
|
|
85
|
-
def get_dataset_identifier(self) -> DatasetIdentifier:
|
|
86
|
-
return _DummyIdentifier(self)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
class _DummyIdentifier(DatasetIdentifier):
|
|
90
|
-
def __init__(self, dataset):
|
|
91
|
-
super().__init__(dataset)
|
|
92
|
-
self.name = dataset.name
|
|
93
|
-
|
|
94
|
-
def __str__(self):
|
|
95
|
-
return self.name
|
|
96
|
-
|
|
97
|
-
def __eq__(self, other):
|
|
98
|
-
return self.name == other.name
|
|
99
|
-
|
|
100
|
-
def __hash__(self):
|
|
101
|
-
return hash(self.name)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
def suite():
|
|
105
|
-
test_suite = unittest.TestSuite()
|
|
106
|
-
for ui in (TestProcessManager,):
|
|
107
|
-
test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ui))
|
|
108
|
-
return test_suite
|
|
File without changes
|
|
File without changes
|
|
File without changes
|