Skip to content

Commit

Permalink
Improve ij.IJ mock to provide an IJ.run() method
Browse files Browse the repository at this point in the history
  • Loading branch information
ehrenfeu committed Mar 5, 2024
1 parent a1f6401 commit 220e7a9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
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.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ packages = [
]

readme = "README.md"
version = "0.1.1"
version = "0.2.0"

[tool.poetry.dependencies]
python = ">=2.7"
Expand Down
21 changes: 20 additions & 1 deletion src/ij/__init__.py
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)

0 comments on commit 220e7a9

Please sign in to comment.