Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from cgalibern/fix-om-mon-stack-after-daemon-s…
…tartup Fix 'om mon' stack, when called just after daemon startup
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import pytest | ||
|
||
from env import Env | ||
from utilities.render.cluster import format_cluster | ||
|
||
|
||
@pytest.mark.ci | ||
class TestFormatCluster(object): | ||
@staticmethod | ||
def test_show_monitor_state_undef_when_monitor_has_not_yet_state(mocker): | ||
mocker.patch.object(Env, "nodename", "node1") | ||
output = format_cluster(node=[Env.nodename], | ||
data={"monitor": {"nodes": {}, "services": {}}}) | ||
assert output == """Threads node1 | ||
daemon running | | ||
monitor undef | ||
Nodes node1 | ||
score | | ||
load 15m | | ||
mem | - | ||
swap | - | ||
compat warn | | ||
state | | ||
*/svc/* node1 | ||
""" |
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