mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Fix CI
This commit is contained in:
parent
6c1f44242c
commit
ec1d5e617e
7
.gitignore
vendored
7
.gitignore
vendored
@ -15,10 +15,6 @@ tests/config/home-assistant.log
|
|||||||
*.sublime-project
|
*.sublime-project
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
|
|
||||||
# Hide code validator output
|
|
||||||
pep8.txt
|
|
||||||
pylint.txt
|
|
||||||
|
|
||||||
# Hide some OS X stuff
|
# Hide some OS X stuff
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.AppleDouble
|
.AppleDouble
|
||||||
@ -30,6 +26,9 @@ Icon
|
|||||||
|
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
# pytest
|
||||||
|
.cache
|
||||||
|
|
||||||
# GITHUB Proposed Python stuff:
|
# GITHUB Proposed Python stuff:
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
|
|
||||||
|
@ -79,11 +79,11 @@ def if_action(hass, config):
|
|||||||
now = dt_util.now()
|
now = dt_util.now()
|
||||||
if before is not None and now > now.replace(hour=before.hour,
|
if before is not None and now > now.replace(hour=before.hour,
|
||||||
minute=before.minute):
|
minute=before.minute):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if after is not None and now < now.replace(hour=after.hour,
|
if after is not None and now < now.replace(hour=after.hour,
|
||||||
minute=after.minute):
|
minute=after.minute):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if weekday is not None:
|
if weekday is not None:
|
||||||
now_weekday = WEEKDAYS[now.weekday()]
|
now_weekday = WEEKDAYS[now.weekday()]
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 63e039a221ae6771e0d7c6990d9a93b7cc22fc64
|
Subproject commit 68f6c6ae5d37a1f0fcd1c36a8803581f9367ac5f
|
@ -134,6 +134,9 @@ def humanify(events):
|
|||||||
if event.event_type == EVENT_STATE_CHANGED:
|
if event.event_type == EVENT_STATE_CHANGED:
|
||||||
entity_id = event.data['entity_id']
|
entity_id = event.data['entity_id']
|
||||||
|
|
||||||
|
if entity_id is None:
|
||||||
|
continue
|
||||||
|
|
||||||
if entity_id.startswith('sensor.'):
|
if entity_id.startswith('sensor.'):
|
||||||
last_sensor_event[entity_id] = event
|
last_sensor_event[entity_id] = event
|
||||||
|
|
||||||
|
2
pytest.ini
Normal file
2
pytest.ini
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[pytest]
|
||||||
|
testpaths = tests
|
@ -4,4 +4,9 @@
|
|||||||
# designed to run on the continuous integration server.
|
# designed to run on the continuous integration server.
|
||||||
|
|
||||||
script/test coverage
|
script/test coverage
|
||||||
|
|
||||||
|
STATUS=$?
|
||||||
|
|
||||||
coveralls
|
coveralls
|
||||||
|
|
||||||
|
exit $STATUS
|
||||||
|
11
script/lint
11
script/lint
@ -3,7 +3,16 @@
|
|||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
echo "Checking style with flake8..."
|
echo "Checking style with flake8..."
|
||||||
flake8 homeassistant
|
flake8 --exclude www_static homeassistant
|
||||||
|
|
||||||
|
STATUS=$?
|
||||||
|
|
||||||
echo "Checking style with pylint..."
|
echo "Checking style with pylint..."
|
||||||
pylint homeassistant
|
pylint homeassistant
|
||||||
|
|
||||||
|
if [ $STATUS -eq 0 ]
|
||||||
|
then
|
||||||
|
exit $?
|
||||||
|
else
|
||||||
|
exit $STATUS
|
||||||
|
fi
|
||||||
|
13
script/test
13
script/test
@ -7,10 +7,19 @@ cd "$(dirname "$0")/.."
|
|||||||
|
|
||||||
script/lint
|
script/lint
|
||||||
|
|
||||||
|
STATUS=$?
|
||||||
|
|
||||||
echo "Running tests..."
|
echo "Running tests..."
|
||||||
|
|
||||||
if [ "$1" = "coverage" ]; then
|
if [ "$1" = "coverage" ]; then
|
||||||
py.test --cov homeassistant tests
|
py.test --cov --cov-report=
|
||||||
else
|
else
|
||||||
py.test tests
|
py.test
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $STATUS -eq 0 ]
|
||||||
|
then
|
||||||
|
exit $?
|
||||||
|
else
|
||||||
|
exit $STATUS
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user