mirror of
https://github.com/home-assistant/core.git
synced 2025-09-02 09:01:05 +00:00
.github
docs
homeassistant
script
tests
auth
components
air_quality
alarm_control_panel
alert
alexa
ambient_station
api
api_streams
apns
arlo
asuswrt
aurora
auth
automatic
automation
awair
aws
axis
bayesian
binary_sensor
blackbird
bom
caldav
calendar
camera
canary
cast
climate
cloud
coinmarketcap
command_line
config
configurator
conversation
counter
cover
daikin
darksky
datadog
deconz
default_config
demo
device_sun_light_trigger
device_tracker
dialogflow
directv
discovery
dsmr
dte_energy_bridge
duckdns
dyson
ecobee
ee_brightbox
efergy
emulated_hue
emulated_roku
esphome
everlights
facebook
facebox
fail2ban
fan
feedreader
ffmpeg
fido
file
filesize
filter
flux
folder
folder_watcher
foobot
freedns
fritzbox
frontend
generic
generic_thermostat
geo_json_events
geo_location
geo_rss_events
geofency
google
google_assistant
google_domains
google_pubsub
google_wifi
gpslogger
graphite
group
hangouts
hassio
hddtemp
history
history_graph
history_stats
homeassistant
homekit
homekit_controller
homematic
homematicip_cloud
honeywell
html5
http
huawei_lte
hue
hydroquebec
ifttt
image_processing
imap_email_content
influxdb
input_boolean
input_datetime
input_number
input_select
input_text
integration
intent_script
introduction
ios
ipma
islamic_prayer_times
jewish_calendar
kira
light
litejet
__init__.py
test_init.py
test_light.py
test_scene.py
test_switch.py
local_file
locative
lock
logbook
logentries
logger
london_air
lovelace
luftdaten
mailbox
mailgun
manual
manual_mqtt
marytts
media_player
melissa
meraki
mfi
mhz19
microsoft_face
microsoft_face_detect
microsoft_face_identify
min_max
mobile_app
mochad
mold_indicator
monoprice
moon
mqtt
mqtt_eventstream
mqtt_json
mqtt_room
mqtt_statestream
mythicbeastsdns
namecheapdns
ness_alarm
nest
no_ip
notify
nsw_fuel_station
nsw_rural_fire_service_feed
nuheat
nx584
onboarding
openalpr_cloud
openalpr_local
openhardwaremonitor
openuv
owntracks
panel_custom
panel_iframe
persistent_notification
person
pilight
plant
point
prometheus
proximity
ps4
push
pushbullet
python_script
qwikswitch
radarr
rainmachine
random
recorder
reddit
remember_the_milk
remote
rest
rest_command
rflink
rfxtrx
ring
rmvtransport
rss_feed_template
samsungtv
scene
script
season
sensor
shell_command
shopping_list
sigfox
simplisafe
simulated
sleepiq
smartthings
smhi
smtp
snips
sonarr
sonos
soundtouch
spaceapi
spc
splunk
sql
srp_energy
startca
statistics
statsd
stream
sun
switch
system_health
system_log
tcp
teksavvy
tellduslive
template
threshold
time_date
timer
tod
tomato
toon
tplink
tradfri
transport_nsw
trend
tts
twilio
uk_transport
unifi
unifi_direct
universal
upc_connect
updater
upnp
uptime
usgs_earthquakes_feed
utility_meter
uvc
vacuum
verisure
version
voicerss
vultr
wake_on_lan
water_heater
weather
webhook
weblink
webostv
websocket_api
workday
worldclock
wsdot
wunderground
xiaomi
xiaomi_miio
yamaha
yandextts
yessssms
yr
yweather
zha
zone
zwave
__init__.py
conftest.py
fixtures
helpers
mock
resources
scripts
test_util
testing_config
util
__init__.py
common.py
conftest.py
test_bootstrap.py
test_config.py
test_config_entries.py
test_core.py
test_data_entry_flow.py
test_loader.py
test_main.py
test_requirements.py
test_setup.py
virtualization
.coveragerc
.dockerignore
.gitattributes
.gitignore
.hound.yml
.ignore
.readthedocs.yml
.travis.yml
CLA.md
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile
LICENSE.md
MANIFEST.in
README.rst
mypy.ini
pylintrc
requirements_all.txt
requirements_docs.txt
requirements_test.txt
requirements_test_all.txt
setup.cfg
setup.py
tox.ini

* Move all components into folders * Move component tests into folders * Fix init moving * Move tests * Lint * Update coverage * Fix service descriptions * Update CODEOWNERS
46 lines
1.5 KiB
Python
46 lines
1.5 KiB
Python
"""The tests for the litejet component."""
|
|
import logging
|
|
import unittest
|
|
|
|
from homeassistant.components import litejet
|
|
from tests.common import get_test_home_assistant
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
class TestLiteJet(unittest.TestCase):
|
|
"""Test the litejet component."""
|
|
|
|
def setup_method(self, method):
|
|
"""Set up things to be run when tests are started."""
|
|
self.hass = get_test_home_assistant()
|
|
self.hass.start()
|
|
self.hass.block_till_done()
|
|
|
|
def teardown_method(self, method):
|
|
"""Stop everything that was started."""
|
|
self.hass.stop()
|
|
|
|
def test_is_ignored_unspecified(self):
|
|
"""Ensure it is ignored when unspecified."""
|
|
self.hass.data['litejet_config'] = {}
|
|
assert not litejet.is_ignored(self.hass, 'Test')
|
|
|
|
def test_is_ignored_empty(self):
|
|
"""Ensure it is ignored when empty."""
|
|
self.hass.data['litejet_config'] = {
|
|
litejet.CONF_EXCLUDE_NAMES: []
|
|
}
|
|
assert not litejet.is_ignored(self.hass, 'Test')
|
|
|
|
def test_is_ignored_normal(self):
|
|
"""Test if usually ignored."""
|
|
self.hass.data['litejet_config'] = {
|
|
litejet.CONF_EXCLUDE_NAMES: ['Test', 'Other One']
|
|
}
|
|
assert litejet.is_ignored(self.hass, 'Test')
|
|
assert not litejet.is_ignored(self.hass, 'Other one')
|
|
assert not litejet.is_ignored(self.hass, 'Other 0ne')
|
|
assert litejet.is_ignored(self.hass, 'Other One There')
|
|
assert litejet.is_ignored(self.hass, 'Other One')
|