|
2 | 2 |
|
3 | 3 | import logging |
4 | 4 |
|
| 5 | +from org.scijava.script import ScriptInfo, ScriptModule |
| 6 | + |
5 | 7 | import imcflibs.imagej.misc |
6 | 8 |
|
7 | 9 | from imcflibs.imagej.misc import bytes_to_human_readable |
|
11 | 13 | PASSWORD_ITEMS = ["OMERO_PASSWD"] |
12 | 14 |
|
13 | 15 |
|
14 | | -class ModuleItem: |
15 | | - """Mock for the org.scijava.module.ModuleItem interface.""" |
16 | | - |
17 | | - def __init__(self, input_name): |
18 | | - """ModuleItem constructor. |
19 | | -
|
20 | | - Parameters |
21 | | - ---------- |
22 | | - input_name : str |
23 | | - FIXME: describe (see the ScriptModule class) |
24 | | - """ |
25 | | - self.input_name = input_name |
26 | | - |
27 | | - def getName(self): |
28 | | - """Getter method for the "input_name" attribute. |
29 | | -
|
30 | | - Returns |
31 | | - ------- |
32 | | - str |
33 | | - """ |
34 | | - return self.input_name |
35 | | - |
36 | | - |
37 | | -class ScriptInfo: |
38 | | - """Mock for the org.scijava.script.ScriptInfo class.""" |
39 | | - |
40 | | - def __init__(self, input_names): |
41 | | - """ScriptInfo constructor. |
42 | | -
|
43 | | - Parameters |
44 | | - ---------- |
45 | | - input_names : list(str) |
46 | | - FIXME: describe (see the ScriptModule class) |
47 | | - """ |
48 | | - self.input_names = [ModuleItem(x) for x in input_names] |
49 | | - |
50 | | - def inputs(self): |
51 | | - """Get the list of input-objects. |
52 | | -
|
53 | | - Returns |
54 | | - ------- |
55 | | - list(ModuleItem) |
56 | | - """ |
57 | | - return self.input_names |
58 | | - |
59 | | - |
60 | | -class ScriptModule: |
61 | | - """Mock for the org.scijava.script.ScriptModule class.""" |
62 | | - |
63 | | - def __init__(self, input_names, inputs): |
64 | | - """ScriptModule constructor. |
65 | | -
|
66 | | - Parameters |
67 | | - ---------- |
68 | | - input_names : list(str) |
69 | | - The list of input names. FIXME: explain better. |
70 | | - inputs : dict |
71 | | - A dict having the `input_names` as keys. Values are representing the |
72 | | - content of the respective script parameter. |
73 | | - """ |
74 | | - self.info = ScriptInfo(input_names) |
75 | | - self.inputs = inputs |
76 | | - |
77 | | - def getInfo(self): |
78 | | - """Getter method for the "info" attribute. |
79 | | -
|
80 | | - Returns |
81 | | - ------- |
82 | | - ScriptInfo |
83 | | - """ |
84 | | - return self.info |
85 | | - |
86 | | - def getInputs(self): |
87 | | - """Getter method for the "inputs" attribute. |
88 | | -
|
89 | | - Returns |
90 | | - ------- |
91 | | - dict |
92 | | - """ |
93 | | - return self.inputs |
94 | | - |
95 | | - |
96 | 16 | def test_save_script_parameters_fail(caplog): |
97 | 17 | """Tests save_script_parameters with an invalid script_globals object.""" |
98 | 18 | caplog.clear() |
|
0 commit comments