File: __init__.py

package info (click to toggle)
graypy 2.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 312 kB
  • sloc: python: 1,175; sh: 114; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 479 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""integration pytests for :mod:`graypy`

.. note::

    These tests require an local instance of Graylog to send messages to.
"""

import requests


def validate_local_graylog_up():
    """Test to see if a localhost instance of Graylog is currently running"""
    try:
        requests.get("http://127.0.0.1:9000/api")
        return True
    except Exception:
        return False


LOCAL_GRAYLOG_UP = validate_local_graylog_up()