From 64306922b101a559d389ff31a403d9b5f5ec75ed Mon Sep 17 00:00:00 2001 From: Jason Hu Date: Sat, 30 Mar 2019 08:30:21 -0700 Subject: [PATCH] Fix name conflict in tests (#22556) * Fix name conflict in tests * Lint * Lint --- .../components/config/test_config_entries.py | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/components/config/test_config_entries.py b/tests/components/config/test_config_entries.py index 852a5adf6a2..6d2304433ab 100644 --- a/tests/components/config/test_config_entries.py +++ b/tests/components/config/test_config_entries.py @@ -31,10 +31,30 @@ def client(hass, hass_client): yield hass.loop.run_until_complete(hass_client()) +@HANDLERS.register('comp1') +class Comp1ConfigFlow: + """Config flow with options flow.""" + + @staticmethod + @callback + def async_get_options_flow(config, options): + """Get options flow.""" + pass + + +@HANDLERS.register('comp2') +class Comp2ConfigFlow: + """Config flow without options flow.""" + + def __init__(self): + """Init.""" + pass + + async def test_get_entries(hass, client): """Test get entries.""" MockConfigEntry( - domain='comp', + domain='comp1', title='Test 1', source='bla', connection_class=core_ce.CONN_CLASS_LOCAL_POLL, @@ -47,18 +67,6 @@ async def test_get_entries(hass, client): connection_class=core_ce.CONN_CLASS_ASSUMED, ).add_to_hass(hass) - class CompConfigFlow: - @staticmethod - @callback - def async_get_options_flow(config, options): - pass - HANDLERS['comp'] = CompConfigFlow() - - class Comp2ConfigFlow: - def __init__(self): - pass - HANDLERS['comp2'] = Comp2ConfigFlow() - resp = await client.get('/api/config/config_entries/entry') assert resp.status == 200 data = await resp.json() @@ -66,7 +74,7 @@ async def test_get_entries(hass, client): entry.pop('entry_id') assert data == [ { - 'domain': 'comp', + 'domain': 'comp1', 'title': 'Test 1', 'source': 'bla', 'state': 'not_loaded',