def test_systemd_network_down(mocker): call_mock = _mock_subprocess_call(mocker, returncode=1) with pytest.raises(SystemExit) as ex: mount_efs.check_network_status(FS_ID, "systemd") utils.assert_called_once(call_mock) assert 0 == ex.value.code
def test_systemd_network_up(mocker): call_mock = _mock_subprocess_call(mocker) mount_efs.check_network_status(FS_ID, "systemd") utils.assert_called_once(call_mock)
def test_non_systemd(mocker): call_mock = _mock_subprocess_call(mocker) mount_efs.check_network_status(FS_ID, "init") utils.assert_not_called(call_mock)