-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve ij.IJ mock to provide an IJ.run() method
- Loading branch information
Showing
3 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
# Changelog 🧾 for `imcf-fiji-mocks` | ||
|
||
## 0.2.0 | ||
|
||
Provide an actual `ij.IJ` class having a `run()` method that will issue a log | ||
message with the parameters handed over, to allow for pytest and caplog setups | ||
to (pseudo) test code that issues the famous `IJ.run()` calls. | ||
|
||
## 0.1.1 | ||
|
||
Allow the package to be built on / for Python 2.7 - no functional modifications. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
IJ = None | ||
from __future__ import print_function | ||
|
||
import logging | ||
|
||
ImageStack = None | ||
Prefs = None | ||
ImagePlus = None | ||
|
||
|
||
_log = logging.getLogger() | ||
_log.setLevel(logging.DEBUG) | ||
|
||
|
||
class IJ(object): | ||
|
||
"""Dummy class providing a way to call `IJ.run()`. | ||
The sole purpose of this is to be used with pytest by simply printing the | ||
command and its parameters to stdout.""" | ||
|
||
@staticmethod | ||
def run(cmd, params): | ||
_log.warning("IJ.run(cmd=[%s], params=[%s])", cmd, params) |