mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-21 22:48:16 +01:00
modified tests for hookable log data
This commit is contained in:
parent
7fd6361d30
commit
125bd07162
3 changed files with 14 additions and 14 deletions
|
@ -80,7 +80,7 @@
|
||||||
"options": null,
|
"options": null,
|
||||||
"source": "hidden",
|
"source": "hidden",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "4.1.8.a11"
|
"value": "4.1.10.a1"
|
||||||
},
|
},
|
||||||
"CSVLOGFILES": {
|
"CSVLOGFILES": {
|
||||||
"description": "Write sensor data to csv logfiles",
|
"description": "Write sensor data to csv logfiles",
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
"value": "No"
|
"value": "No"
|
||||||
},
|
},
|
||||||
"INFLUXDBADDR": {
|
"INFLUXDBADDR": {
|
||||||
"description": "IP Address of your influxdb server (If INFLUXDBCLOUD set to Yes use URL Address of your influxdb cloud server)",
|
"description": "URL Address of your influxdb server incl. http:// and port, e.g. http://localhost:8086 (If INFLUXDBCLOUD set to Yes use URL Address of your influxdb cloud server)",
|
||||||
"name": "INFLUXDBADDR",
|
"name": "INFLUXDBADDR",
|
||||||
"options": null,
|
"options": null,
|
||||||
"source": "craftbeerpi",
|
"source": "craftbeerpi",
|
||||||
|
@ -157,14 +157,6 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"value": "cbpi4"
|
"value": "cbpi4"
|
||||||
},
|
},
|
||||||
"INFLUXDBPORT": {
|
|
||||||
"description": "Port of your influxdb server",
|
|
||||||
"name": "INFLUXDBPORT",
|
|
||||||
"options": null,
|
|
||||||
"source": "craftbeerpi",
|
|
||||||
"type": "string",
|
|
||||||
"value": "8086"
|
|
||||||
},
|
|
||||||
"INFLUXDBPWD": {
|
"INFLUXDBPWD": {
|
||||||
"description": "Password for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use token of your influxdb cloud database)",
|
"description": "Password for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use token of your influxdb cloud database)",
|
||||||
"name": "INFLUXDBPWD",
|
"name": "INFLUXDBPWD",
|
||||||
|
@ -174,7 +166,7 @@
|
||||||
"value": " "
|
"value": " "
|
||||||
},
|
},
|
||||||
"INFLUXDBUSER": {
|
"INFLUXDBUSER": {
|
||||||
"description": "User name for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use organisation of your influxdb cloud database)",
|
"description": "User Name for your influxdb database (only if required)(If INFLUXDBCLOUD set to Yes use organisation of your influxdb cloud database)",
|
||||||
"name": "INFLUXDBUSER",
|
"name": "INFLUXDBUSER",
|
||||||
"options": null,
|
"options": null,
|
||||||
"source": "craftbeerpi",
|
"source": "craftbeerpi",
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
{
|
{
|
||||||
"data": []
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "unconfigured_test_sensor_ID",
|
||||||
|
"name": "unconfigured_mqtt_sensor",
|
||||||
|
"props": {},
|
||||||
|
"state": false,
|
||||||
|
"type": "MQTTSensor"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
|
@ -10,10 +10,10 @@ class LoggerTestCase(CraftBeerPiTestCase):
|
||||||
async def test_log_data(self):
|
async def test_log_data(self):
|
||||||
|
|
||||||
os.makedirs(os.path.join(".", "tests", "logs"), exist_ok=True)
|
os.makedirs(os.path.join(".", "tests", "logs"), exist_ok=True)
|
||||||
log_name = "test"
|
log_name = "unconfigured_test_sensor_ID"
|
||||||
#clear all logs
|
#clear all logs
|
||||||
self.cbpi.log.clear_log(log_name)
|
self.cbpi.log.clear_log(log_name)
|
||||||
assert len(glob.glob(os.path.join(".", "tests", "logs", f"sensor_{log_name}.log*"))) == 0
|
assert len(glob.glob(os.path.join(self.cbpi.log.logsFolderPath, f"sensor_{log_name}.log*"))) == 0
|
||||||
|
|
||||||
# write log entries
|
# write log entries
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
|
|
Loading…
Reference in a new issue