# Path: test/settings/basic.py
# PROCESS_DELAY_MQTT = 0.3
# class BasicSettings:
# 
# Path: test/util.py
# def http_json_sensor(topic, data):
#     uri = 'http://localhost:24642/api{}'.format(topic)
#     logger.info('HTTP: Submitting reading to {} using JSON'.format(uri))
#     return requests.post(uri, json=data)
# 
# def sleep(secs):
#     # https://gist.github.com/jhorman/891717
#     return deferLater(reactor, secs, lambda: None)


import logging
import pytest
import pytest_twisted
from twisted.internet import threads
from test.settings.basic import settings, influx_sensors, create_influxdb, reset_influxdb, reset_grafana, PROCESS_DELAY_MQTT
from test.util import http_json_sensor, sleep
    },
    {
      "value_type": "max_micro",
      "value": "26303"
    },
    {
      "value_type": "signal",
      "value": "-66"
    }
  ],
  "software_version": "NRZ-2018-123B"
}


data_out = {
  u'SDS_P1': 35.67,
  u'SDS_P2': 17.00,
  u'BME280_temperature': -2.83,
  u'BME280_humidity': 66.73,
  u'BME280_pressure': 100535.97,
  u'samples': 3016882,
  u'min_micro': 77,
  u'max_micro': 26303,
  u'signal': -66,
}


@pytest_twisted.inlineCallbacks
@pytest.mark.http
@pytest.mark.airrohr

# Path: test/settings/basic.py
# PROCESS_DELAY_MQTT = 0.3
# class BasicSettings:
# 
# Path: test/util.py
# def http_json_sensor(topic, data):
#     uri = 'http://localhost:24642/api{}'.format(topic)
#     logger.info('HTTP: Submitting reading to {} using JSON'.format(uri))
#     return requests.post(uri, json=data)
# 
# def sleep(secs):
#     # https://gist.github.com/jhorman/891717
#     return deferLater(reactor, secs, lambda: None)


# Path: test/test_airrohr.py
import logging
import pytest
import pytest_twisted
from twisted.internet import threads
from test.settings.basic import settings, influx_sensors, create_influxdb, reset_influxdb, reset_grafana, PROCESS_DELAY_MQTT
from test.util import http_json_sensor, sleep

    },
    {
      "value_type": "max_micro",
      "value": "26303"
    },
    {
      "value_type": "signal",
      "value": "-66"
    }
  ],
  "software_version": "NRZ-2018-123B"
}


data_out = {
  u'SDS_P1': 35.67,
  u'SDS_P2': 17.00,
  u'BME280_temperature': -2.83,
  u'BME280_humidity': 66.73,
  u'BME280_pressure': 100535.97,
  u'samples': 3016882,
  u'min_micro': 77,
  u'max_micro': 26303,
  u'signal': -66,
}


@pytest_twisted.inlineCallbacks
@pytest.mark.http
@pytest.mark.airrohr

def test_airrohr_http_json(machinery_basic, create_influxdb, reset_influxdb):