Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* In is_running(), list CLI commands generically, also allowing commands from loaded plugins to do things outside of one account only Signed-off-by: Nicolas Höning <nicolas@seita.nl> * add a test for new util function cli.is_running Signed-off-by: Nicolas Höning <nicolas@seita.nl>
- Loading branch information
Showing
2 changed files
with
12 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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sys | ||
|
||
from flexmeasures.cli import is_running as cli_is_running | ||
|
||
|
||
def test_cli_is_running(app, monkeypatch): | ||
assert cli_is_running() is False | ||
monkeypatch.setattr( | ||
sys, "argv", ["/bin/flexmeasures", "add", "account", "--name", "XCorp."] | ||
) | ||
assert cli_is_running() is True |