Black
This commit is contained in:
1 parent
da05dfe708
commit
4de97abc3a
2676 files changed
+163166
-140084
No files matched your search
@@ -33,22 +33,14 @@ class TestFileSensor(unittest.TestCase):
|
||||
|
||||
def test_invalid_path(self):
|
||||
"""Test that an invalid path is caught."""
|
||||
config = {
|
||||
"sensor": {
|
||||
"platform": "filesize", CONF_FILE_PATHS: ["invalid_path"]
|
||||
}
|
||||
}
|
||||
config = {"sensor": {"platform": "filesize", CONF_FILE_PATHS: ["invalid_path"]}}
|
||||
assert setup_component(self.hass, "sensor", config)
|
||||
assert len(self.hass.states.entity_ids()) == 0
|
||||
|
||||
def test_valid_path(self):
|
||||
"""Test for a valid path."""
|
||||
create_file(TEST_FILE)
|
||||
config = {
|
||||
"sensor": {
|
||||
"platform": "filesize", CONF_FILE_PATHS: [TEST_FILE]
|
||||
}
|
||||
}
|
||||
config = {"sensor": {"platform": "filesize", CONF_FILE_PATHS: [TEST_FILE]}}
|
||||
assert setup_component(self.hass, "sensor", config)
|
||||
assert len(self.hass.states.entity_ids()) == 1
|
||||
state = self.hass.states.get("sensor.mock_file_test_filesize_txt")
|
||||
|
||||
Reference in new issue
Block a user