Skip to content

Commit

Permalink
Improve tests of inheriting entity descriptions (home-assistant#106647)
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery authored Dec 29, 2023
1 parent 95d7a66 commit 56a58f9
Show file tree
Hide file tree
Showing 2 changed files with 380 additions and 10 deletions.
206 changes: 203 additions & 3 deletions tests/helpers/snapshots/test_entity.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,99 @@
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.11
"test_extending_entity_description.<locals>.CustomInitEntityDescription(key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None)"
"test_extending_entity_description.<locals>.ComplexEntityDescription1C(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.12
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.13
"test_extending_entity_description.<locals>.ComplexEntityDescription1D(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.14
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.15
"test_extending_entity_description.<locals>.ComplexEntityDescription2A(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.16
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.17
"test_extending_entity_description.<locals>.ComplexEntityDescription2B(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.18
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.19
"test_extending_entity_description.<locals>.ComplexEntityDescription2C(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.2
dict({
Expand All @@ -70,9 +152,127 @@
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.20
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.21
"test_extending_entity_description.<locals>.ComplexEntityDescription2D(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.22
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.23
"test_extending_entity_description.<locals>.ComplexEntityDescription3A(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.24
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.25
"test_extending_entity_description.<locals>.ComplexEntityDescription3B(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.26
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.27
"test_extending_entity_description.<locals>.ComplexEntityDescription4A(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.28
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'extra': 'foo',
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'mixin': 'mixin',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.29
"test_extending_entity_description.<locals>.ComplexEntityDescription4B(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.3
"test_extending_entity_description.<locals>.ThawedEntityDescription(key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.30
dict({
'device_class': None,
'entity_category': None,
'entity_registry_enabled_default': True,
'entity_registry_visible_default': True,
'force_update': False,
'has_entity_name': False,
'icon': None,
'key': 'blah',
'name': 'name',
'translation_key': None,
'unit_of_measurement': None,
})
# ---
# name: test_extending_entity_description.31
"test_extending_entity_description.<locals>.CustomInitEntityDescription(key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None)"
# ---
# name: test_extending_entity_description.4
dict({
'device_class': None,
Expand Down Expand Up @@ -111,7 +311,7 @@
})
# ---
# name: test_extending_entity_description.7
"test_extending_entity_description.<locals>.ComplexEntityDescription1(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
"test_extending_entity_description.<locals>.ComplexEntityDescription1A(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
# name: test_extending_entity_description.8
dict({
Expand All @@ -131,5 +331,5 @@
})
# ---
# name: test_extending_entity_description.9
"test_extending_entity_description.<locals>.ComplexEntityDescription2(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
"test_extending_entity_description.<locals>.ComplexEntityDescription1B(mixin='mixin', key='blah', device_class=None, entity_category=None, entity_registry_enabled_default=True, entity_registry_visible_default=True, force_update=False, icon=None, has_entity_name=False, name='name', translation_key=None, unit_of_measurement=None, extra='foo')"
# ---
Loading

0 comments on commit 56a58f9

Please sign in to comment.