response
stringlengths
1
33.1k
instruction
stringlengths
22
582k
Convert a list of items into a shopping list.
def items_to_shopping_list(items: list, version_id: str = "1") -> dict[dict[list]]: """Convert a list of items into a shopping list.""" return {"list": {"versionId": version_id, "items": items}}
Return the default mocked config entry.
def mock_config_entry() -> MockConfigEntry: """Return the default mocked config entry.""" return MockConfigEntry( title="Somfy TaHoma Switch", domain=DOMAIN, unique_id=TEST_GATEWAY_ID, data={"username": TEST_EMAIL, "password": TEST_PASSWORD, "hub": TEST_SERVER}, )
Mock setting up a config entry.
def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Mock setting up a config entry.""" with patch( "homeassistant.components.overkiz.async_setup_entry", return_value=True ) as mock_setup_entry: yield mock_setup_entry
Return setup from fixture.
def load_setup_fixture( fixture: str = "overkiz/setup_tahoma_switch.json", ) -> Setup: """Return setup from fixture.""" setup_json = load_json_object_fixture(fixture) return Setup(**humps.decamelize(setup_json))
Mock webhook_id.
def mock_webhook_id(): """Mock webhook_id.""" with patch( "homeassistant.components.webhook.async_generate_id", return_value=WEBHOOK_ID ): yield
Mock secret.
def mock_secret(): """Mock secret.""" with patch("secrets.token_hex", return_value=SECRET): yield
Mock non successful nacl import.
def mock_not_supports_encryption(): """Mock non successful nacl import.""" with patch( "homeassistant.components.owntracks.config_flow.supports_encryption", return_value=False, ): yield
Build a test message from overrides and another message.
def build_message(test_params, default_params): """Build a test message from overrides and another message.""" new_params = default_params.copy() new_params.update(test_params) return new_params
Initialize components.
def setup_comp(hass, mock_device_tracker_conf, mqtt_mock): """Initialize components.""" hass.loop.run_until_complete(async_setup_component(hass, "device_tracker", {})) hass.states.async_set("zone.inner", "zoning", INNER_ZONE) hass.states.async_set("zone.inner_2", "zoning", INNER_ZONE) hass.states.async_set("zone.outer", "zoning", OUTER_ZONE)
Set up the mocked context.
def context(hass, setup_comp): """Set up the mocked context.""" orig_context = owntracks.OwnTracksContext context = None def store_context(*args): """Store the context.""" nonlocal context context = orig_context(*args) return context hass.loop.run_until_complete( setup_owntracks( hass, { CONF_MAX_GPS_ACCURACY: 200, CONF_WAYPOINT_IMPORT: True, CONF_WAYPOINT_WHITELIST: ["jon", "greg"], }, store_context, ) ) def get_context(): """Get the current context.""" return context return get_context
Test the assertion of a location state.
def assert_location_state(hass, location): """Test the assertion of a location state.""" state = hass.states.get(DEVICE_TRACKER_STATE) assert state.state == location
Test the assertion of a location latitude.
def assert_location_latitude(hass, latitude): """Test the assertion of a location latitude.""" state = hass.states.get(DEVICE_TRACKER_STATE) assert state.attributes.get("latitude") == latitude
Test the assertion of a location longitude.
def assert_location_longitude(hass, longitude): """Test the assertion of a location longitude.""" state = hass.states.get(DEVICE_TRACKER_STATE) assert state.attributes.get("longitude") == longitude
Test the assertion of a location accuracy.
def assert_location_accuracy(hass, accuracy): """Test the assertion of a location accuracy.""" state = hass.states.get(DEVICE_TRACKER_STATE) assert state.attributes.get("gps_accuracy") == accuracy
Test the assertion of source_type.
def assert_location_source_type(hass, source_type): """Test the assertion of source_type.""" state = hass.states.get(DEVICE_TRACKER_STATE) assert state.attributes.get("source_type") == source_type
Test the assertion of a mobile beacon tracker state.
def assert_mobile_tracker_state(hass, location, beacon=IBEACON_DEVICE): """Test the assertion of a mobile beacon tracker state.""" dev_id = MOBILE_BEACON_FMT.format(beacon) state = hass.states.get(dev_id) assert state.state == location
Test the assertion of a mobile beacon tracker latitude.
def assert_mobile_tracker_latitude(hass, latitude, beacon=IBEACON_DEVICE): """Test the assertion of a mobile beacon tracker latitude.""" dev_id = MOBILE_BEACON_FMT.format(beacon) state = hass.states.get(dev_id) assert state.attributes.get("latitude") == latitude
Test the assertion of a mobile beacon tracker accuracy.
def assert_mobile_tracker_accuracy(hass, accuracy, beacon=IBEACON_DEVICE): """Test the assertion of a mobile beacon tracker accuracy.""" dev_id = MOBILE_BEACON_FMT.format(beacon) state = hass.states.get(dev_id) assert state.attributes.get("gps_accuracy") == accuracy
Generate test ciphers for the DEFAULT_LOCATION_MESSAGE.
def generate_ciphers(secret): """Generate test ciphers for the DEFAULT_LOCATION_MESSAGE.""" # PyNaCl ciphertext generation will fail if the module # cannot be imported. However, the test for decryption # also relies on this library and won't be run without it. import base64 import pickle try: from nacl.encoding import Base64Encoder from nacl.secret import SecretBox keylen = SecretBox.KEY_SIZE key = secret.encode("utf-8") key = key[:keylen] key = key.ljust(keylen, b"\0") msg = json.dumps(DEFAULT_LOCATION_MESSAGE).encode("utf-8") ctxt = SecretBox(key).encrypt(msg, encoder=Base64Encoder).decode("utf-8") except (ImportError, OSError): ctxt = "" mctxt = base64.b64encode( pickle.dumps( ( secret.encode("utf-8"), json.dumps(DEFAULT_LOCATION_MESSAGE).encode("utf-8"), ) ) ).decode("utf-8") return ctxt, mctxt
Return a dummy pickle-based cipher.
def mock_cipher(): """Return a dummy pickle-based cipher.""" def mock_decrypt(ciphertext, key): """Decrypt/unpickle.""" import base64 import pickle (mkey, plaintext) = pickle.loads(base64.b64decode(ciphertext)) if key != mkey: raise ValueError return plaintext return len(TEST_SECRET_KEY), mock_decrypt
Set up the mocked context.
def config_context(hass, setup_comp): """Set up the mocked context.""" patch_load = patch( "homeassistant.components.device_tracker.async_load_config", return_value=[], ) patch_load.start() patch_save = patch( "homeassistant.components.device_tracker.DeviceTracker.async_update_config" ) patch_save.start() yield patch_load.stop() patch_save.stop()
Mock non successful nacl import.
def mock_not_supports_encryption(): """Mock non successful nacl import.""" with patch( "homeassistant.components.owntracks.messages.supports_encryption", return_value=False, ): yield
Mock non successful cipher.
def mock_get_cipher_error(): """Mock non successful cipher.""" with patch( "homeassistant.components.owntracks.messages.get_cipher", side_effect=OSError() ): yield
Mock a successful import.
def mock_nacl_imported(): """Mock a successful import.""" with patch("homeassistant.components.owntracks.helper.nacl"): yield
Mock non successful import.
def mock_nacl_not_imported(): """Mock non successful import.""" with patch("homeassistant.components.owntracks.helper.nacl", new=None): yield
Test if env supports encryption.
def test_supports_encryption(nacl_imported) -> None: """Test if env supports encryption.""" assert helper.supports_encryption()
Test if env does not support encryption.
def test_supports_encryption_failed(nacl_not_imported) -> None: """Test if env does not support encryption.""" assert not helper.supports_encryption()
Mock device tracker config loading.
def mock_dev_track(mock_device_tracker_conf): """Mock device tracker config loading."""
Start the Home Assistant HTTP component.
def mock_client(hass, hass_client_no_auth): """Start the Home Assistant HTTP component.""" mock_component(hass, "group") mock_component(hass, "zone") mock_component(hass, "device_tracker") MockConfigEntry( domain="owntracks", data={"webhook_id": "owntracks_test", "secret": "abcd"} ).add_to_hass(hass) hass.loop.run_until_complete(async_setup_component(hass, "owntracks", {})) return hass.loop.run_until_complete(hass_client_no_auth())
Test that context is able to hold pending messages while being init.
def test_context_delivers_pending_msg() -> None: """Test that context is able to hold pending messages while being init.""" context = owntracks.OwnTracksContext(None, None, None, None, None, None, None, None) context.async_see(hello="world") context.async_see(world="hello") received = [] context.set_async_see(lambda **data: received.append(data)) assert len(received) == 2 assert received[0] == {"hello": "world"} assert received[1] == {"world": "hello"} received.clear() context.set_async_see(lambda **data: received.append(data)) assert len(received) == 0
Return the default mocked config entry.
def mock_config_entry() -> MockConfigEntry: """Return the default mocked config entry.""" return MockConfigEntry( title="monitor", domain=DOMAIN, data={CONF_HOST: "example"}, unique_id="unique_thingy", )
Return a mocked P1 Monitor client.
def mock_p1monitor(): """Return a mocked P1 Monitor client.""" with patch("homeassistant.components.p1_monitor.P1Monitor") as p1monitor_mock: client = p1monitor_mock.return_value client.smartmeter = AsyncMock( return_value=SmartMeter.from_dict( json.loads(load_fixture("p1_monitor/smartmeter.json")) ) ) client.phases = AsyncMock( return_value=Phases.from_dict( json.loads(load_fixture("p1_monitor/phases.json")) ) ) client.settings = AsyncMock( return_value=Settings.from_dict( json.loads(load_fixture("p1_monitor/settings.json")) ) ) client.watermeter = AsyncMock( return_value=WaterMeter.from_dict( json.loads(load_fixture("p1_monitor/watermeter.json")) ) ) yield client
Return a mock remote.
def get_mock_remote( request_error=None, authorize_error=None, encrypted=False, app_id=None, encryption_key=None, device_info=MOCK_DEVICE_INFO, ): """Return a mock remote.""" mock_remote = Mock() mock_remote.type = TV_TYPE_ENCRYPTED if encrypted else TV_TYPE_NONENCRYPTED mock_remote.app_id = app_id mock_remote.enc_key = encryption_key def request_pin_code(name=None): if request_error is not None: raise request_error mock_remote.request_pin_code = request_pin_code def authorize_pin_code(pincode): if pincode == "1234": return if authorize_error is not None: raise authorize_error mock_remote.authorize_pin_code = authorize_pin_code mock_remote.get_device_info = Mock(return_value=device_info) mock_remote.send_key = Mock() mock_remote.get_volume = Mock(return_value=100) return mock_remote
Patch the library remote.
def mock_remote_fixture(): """Patch the library remote.""" mock_remote = get_mock_remote() with patch( "homeassistant.components.panasonic_viera.RemoteControl", return_value=mock_remote, ): yield mock_remote
Override async_setup_entry.
def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Override async_setup_entry.""" with patch( "homeassistant.components.permobil.async_setup_entry", return_value=True ) as mock_setup_entry: yield mock_setup_entry
Mock spec for MyPermobilApi.
def my_permobil() -> Mock: """Mock spec for MyPermobilApi.""" mock = Mock(spec=MyPermobil) mock.request_region_names.return_value = {MOCK_REGION_NAME: MOCK_URL} mock.request_application_token.return_value = MOCK_TOKEN mock.region = "" return mock
Return an empty storage collection.
def storage_collection(hass): """Return an empty storage collection.""" id_manager = collection.IDManager() return person.PersonStorageCollection( person.PersonStore(hass, person.STORAGE_VERSION, person.STORAGE_KEY), id_manager, collection.YamlCollection( logging.getLogger(f"{person.__name__}.yaml_collection"), id_manager ), )
Storage setup.
def storage_setup(hass, hass_storage, hass_admin_user): """Storage setup.""" hass_storage[DOMAIN] = { "key": DOMAIN, "version": 1, "data": { "persons": [ { "id": "1234", "name": "tracked person", "user_id": hass_admin_user.id, "device_trackers": [DEVICE_TRACKER], } ] }, } assert hass.loop.run_until_complete(async_setup_component(hass, DOMAIN, {}))
Disable component setup.
def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Disable component setup.""" with ( patch( "homeassistant.components.philips_js.async_setup_entry", return_value=True ) as mock_setup_entry, patch( "homeassistant.components.philips_js.async_unload_entry", return_value=True ), ): yield mock_setup_entry
Disable component actual use.
def mock_tv(): """Disable component actual use.""" tv = create_autospec(PhilipsTV) tv.sources = {} tv.channels = {} tv.application = None tv.applications = {} tv.system = MOCK_SYSTEM tv.api_version = 1 tv.api_version_detected = None tv.on = True tv.notify_change_supported = False tv.pairing_type = None tv.powerstate = None tv.source_id = None tv.ambilight_current_configuration = None tv.ambilight_styles = {} tv.ambilight_cached = {} with ( patch( "homeassistant.components.philips_js.config_flow.PhilipsTV", return_value=tv ), patch("homeassistant.components.philips_js.PhilipsTV", return_value=tv), ): yield tv
Get standard device.
def mock_device_reg(hass): """Get standard device.""" return mock_device_registry(hass)
Get standard device.
def mock_device(hass, mock_device_reg, mock_entity, mock_config_entry): """Get standard device.""" return mock_device_reg.async_get_or_create( config_entry_id=mock_config_entry.entry_id, identifiers={(DOMAIN, MOCK_SERIAL_NO)}, )
Stub copying the blueprints to the config folder.
def stub_blueprint_populate_autouse(stub_blueprint_populate: None) -> None: """Stub copying the blueprints to the config folder."""
Track calls to a mock service.
def calls(hass): """Track calls to a mock service.""" return async_mock_service(hass, "test", "automation")
Return the default mocked config entry.
def mock_config_entry() -> MockConfigEntry: """Return the default mocked config entry.""" return MockConfigEntry( domain=DOMAIN, data={ CONF_ACCESS_TOKEN: "x-original-picnic-auth-token", CONF_COUNTRY_CODE: "NL", }, unique_id="295-6y3-1nf4", )
Return a mocked PicnicAPI client.
def mock_picnic_api(): """Return a mocked PicnicAPI client.""" with patch("homeassistant.components.picnic.PicnicAPI") as mock: client = mock.return_value client.session.auth_token = "3q29fpwhulzes" client.get_cart.return_value = json.loads(load_fixture("picnic/cart.json")) client.get_user.return_value = json.loads(load_fixture("picnic/user.json")) client.get_deliveries.return_value = json.loads( load_fixture("picnic/delivery.json") ) client.get_delivery_position.return_value = {} yield client
Create PicnicAPI mock with set response data.
def picnic_api(): """Create PicnicAPI mock with set response data.""" auth_token = "af3wh738j3fa28l9fa23lhiufahu7l" auth_data = { "user_id": "f29-2a6-o32n", "address": { "street": "Teststreet", "house_number": 123, "house_number_ext": "b", }, } with patch( "homeassistant.components.picnic.config_flow.PicnicAPI", ) as picnic_mock: picnic_mock().session.auth_token = auth_token picnic_mock().get_user.return_value = auth_data yield picnic_mock
Create PicnicAPI mock with set response data.
def create_picnic_api_client(unique_id): """Create PicnicAPI mock with set response data.""" auth_token = "af3wh738j3fa28l9fa23lhiufahu7l" auth_data = { "user_id": unique_id, "address": { "street": "Teststreet", "house_number": 123, "house_number_ext": "b", }, } picnic_mock = MagicMock() picnic_mock.session.auth_token = auth_token picnic_mock.get_user.return_value = auth_data return picnic_mock
Return the default picnic api client.
def picnic_api_client(): """Return the default picnic api client.""" with patch( "homeassistant.components.picnic.create_picnic_client" ) as create_picnic_client_mock: picnic_client_mock = create_picnic_api_client(UNIQUE_ID) create_picnic_client_mock.return_value = picnic_client_mock yield picnic_client_mock
Test that the limiter is a noop if no delay set.
def test_call_rate_delay_throttle_disabled(hass: HomeAssistant) -> None: """Test that the limiter is a noop if no delay set.""" runs = [] limit = pilight.CallRateDelayThrottle(hass, 0.0) action = limit.limited(lambda x: runs.append(x)) for i in range(3): action(i) assert runs == [0, 1, 2]
Initialize components.
def setup_comp(hass): """Initialize components.""" mock_component(hass, "pilight")
Fire the fake Pilight message.
def fire_pilight_message(hass, protocol, data): """Fire the fake Pilight message.""" message = {pilight.CONF_PROTOCOL: protocol} message.update(data) hass.bus.async_fire(pilight.EVENT, message)
Patch setup methods.
def patch_setup(*args, **kwargs): """Patch setup methods.""" with ( patch( "homeassistant.components.ping.async_setup_entry", return_value=True, ), patch("homeassistant.components.ping.async_setup", return_value=True), ): yield
Test fixture that ensures ping device_tracker entities are enabled in the registry.
def entity_registry_enabled_by_default() -> Generator[None, None, None]: """Test fixture that ensures ping device_tracker entities are enabled in the registry.""" with patch( "homeassistant.components.ping.device_tracker.PingDeviceTracker.entity_registry_enabled_default", return_value=True, ): yield
Create pjlink Projector mock.
def projector_from_address(): """Create pjlink Projector mock.""" with patch("pypjlink.Projector.from_address") as from_address: constructor = create_autospec(pypjlink.Projector) from_address.return_value = constructor.return_value yield from_address
Create pjlink Projector instance mock.
def mocked_projector(projector_from_address): """Create pjlink Projector instance mock.""" instance = projector_from_address.return_value with instance as mocked_instance: mocked_instance.get_name.return_value = "Test" mocked_instance.get_power.return_value = "on" mocked_instance.get_mute.return_value = [0, True] mocked_instance.get_input.return_value = [0, 1] mocked_instance.get_inputs.return_value = ( ("HDMI", 1), ("HDMI", 2), ("VGA", 1), ) yield mocked_instance
Mock webhook_id.
def mock_webhook_id(): """Mock webhook_id.""" with ( patch( "homeassistant.components.webhook.async_generate_id", return_value=WEBHOOK_ID, ), patch( "homeassistant.components.webhook.async_generate_url", return_value="hook_id", ), ): yield
Test with empty history.
def test_daily_history_no_data(hass: HomeAssistant) -> None: """Test with empty history.""" dh = plant.DailyHistory(3) assert dh.max is None
Test storing data for the same day.
def test_daily_history_one_day(hass: HomeAssistant) -> None: """Test storing data for the same day.""" dh = plant.DailyHistory(3) values = [-2, 10, 0, 5, 20] for i in range(len(values)): dh.add_measurement(values[i]) max_value = max(values[0 : i + 1]) assert len(dh._days) == 1 assert dh.max == max_value
Test storing data for different days.
def test_daily_history_multiple_days(hass: HomeAssistant) -> None: """Test storing data for different days.""" dh = plant.DailyHistory(3) today = datetime.now() today_minus_1 = today - timedelta(days=1) today_minus_2 = today_minus_1 - timedelta(days=1) today_minus_3 = today_minus_2 - timedelta(days=1) days = [today_minus_3, today_minus_2, today_minus_1, today] values = [10, 1, 7, 3] max_values = [10, 10, 10, 7] for i in range(len(days)): dh.add_measurement(values[i], days[i]) assert max_values[i] == dh.max
Return a protocol-less URL from a config entry.
def plex_server_url(entry): """Return a protocol-less URL from a config entry.""" return entry.data[PLEX_SERVER_CONFIG][CONF_URL].split(":", 1)[-1]
Override async_setup_entry.
def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Override async_setup_entry.""" with patch( "homeassistant.components.plex.async_setup_entry", return_value=True ) as mock_setup_entry: yield mock_setup_entry
Load album payload and return it.
def album_fixture(): """Load album payload and return it.""" return load_fixture("plex/album.xml")
Load artist's albums payload and return it.
def artist_albums_fixture(): """Load artist's albums payload and return it.""" return load_fixture("plex/artist_albums.xml")
Load children payload for item 20 and return it.
def children_20_fixture(): """Load children payload for item 20 and return it.""" return load_fixture("plex/children_20.xml")
Load children payload for item 30 and return it.
def children_30_fixture(): """Load children payload for item 30 and return it.""" return load_fixture("plex/children_30.xml")
Load children payload for item 200 and return it.
def children_200_fixture(): """Load children payload for item 200 and return it.""" return load_fixture("plex/children_200.xml")
Load children payload for item 300 and return it.
def children_300_fixture(): """Load children payload for item 300 and return it.""" return load_fixture("plex/children_300.xml")
Load an empty library payload and return it.
def empty_library_fixture(): """Load an empty library payload and return it.""" return load_fixture("plex/empty_library.xml")
Load an empty payload and return it.
def empty_payload_fixture(): """Load an empty payload and return it.""" return load_fixture("plex/empty_payload.xml")
Load grandchildren payload for item 300 and return it.
def grandchildren_300_fixture(): """Load grandchildren payload for item 300 and return it.""" return load_fixture("plex/grandchildren_300.xml")
Load payload for all items in the movies library and return it.
def library_movies_all_fixture(): """Load payload for all items in the movies library and return it.""" return load_fixture("plex/library_movies_all.xml")
Load payload for metadata in the movies library and return it.
def library_movies_metadata_fixture(): """Load payload for metadata in the movies library and return it.""" return load_fixture("plex/library_movies_metadata.xml")
Load payload for collections in the movies library and return it.
def library_movies_collections_fixture(): """Load payload for collections in the movies library and return it.""" return load_fixture("plex/library_movies_collections.xml")
Load payload for all items in the tvshows library and return it.
def library_tvshows_all_fixture(): """Load payload for all items in the tvshows library and return it.""" return load_fixture("plex/library_tvshows_all.xml")
Load payload for metadata in the TV shows library and return it.
def library_tvshows_metadata_fixture(): """Load payload for metadata in the TV shows library and return it.""" return load_fixture("plex/library_tvshows_metadata.xml")
Load payload for collections in the TV shows library and return it.
def library_tvshows_collections_fixture(): """Load payload for collections in the TV shows library and return it.""" return load_fixture("plex/library_tvshows_collections.xml")
Load payload for all items in the music library and return it.
def library_music_all_fixture(): """Load payload for all items in the music library and return it.""" return load_fixture("plex/library_music_all.xml")
Load payload for metadata in the music library and return it.
def library_music_metadata_fixture(): """Load payload for metadata in the music library and return it.""" return load_fixture("plex/library_music_metadata.xml")
Load payload for collections in the music library and return it.
def library_music_collections_fixture(): """Load payload for collections in the music library and return it.""" return load_fixture("plex/library_music_collections.xml")
Load sorting payload for movie library and return it.
def library_movies_sort_fixture(): """Load sorting payload for movie library and return it.""" return load_fixture("plex/library_movies_sort.xml")
Load sorting payload for tvshow library and return it.
def library_tvshows_sort_fixture(): """Load sorting payload for tvshow library and return it.""" return load_fixture("plex/library_tvshows_sort.xml")
Load sorting payload for music library and return it.
def library_music_sort_fixture(): """Load sorting payload for music library and return it.""" return load_fixture("plex/library_music_sort.xml")
Load filtertypes payload for movie library and return it.
def library_movies_filtertypes_fixture(): """Load filtertypes payload for movie library and return it.""" return load_fixture("plex/library_movies_filtertypes.xml")
Load library payload and return it.
def library_fixture(): """Load library payload and return it.""" return load_fixture("plex/library.xml")
Load movie library size payload and return it.
def library_movies_size_fixture(): """Load movie library size payload and return it.""" return load_fixture("plex/library_movies_size.xml")
Load music library size payload and return it.
def library_music_size_fixture(): """Load music library size payload and return it.""" return load_fixture("plex/library_music_size.xml")
Load tvshow library size payload and return it.
def library_tvshows_size_fixture(): """Load tvshow library size payload and return it.""" return load_fixture("plex/library_tvshows_size.xml")
Load tvshow library size in episodes payload and return it.
def library_tvshows_size_episodes_fixture(): """Load tvshow library size in episodes payload and return it.""" return load_fixture("plex/library_tvshows_size_episodes.xml")
Load tvshow library size in seasons payload and return it.
def library_tvshows_size_seasons_fixture(): """Load tvshow library size in seasons payload and return it.""" return load_fixture("plex/library_tvshows_size_seasons.xml")
Load library sections payload and return it.
def library_sections_fixture(): """Load library sections payload and return it.""" return load_fixture("plex/library_sections.xml")
Load media payload for item 1 and return it.
def media_1_fixture(): """Load media payload for item 1 and return it.""" return load_fixture("plex/media_1.xml")
Load media payload for item 30 and return it.
def media_30_fixture(): """Load media payload for item 30 and return it.""" return load_fixture("plex/media_30.xml")
Load media payload for item 100 and return it.
def media_100_fixture(): """Load media payload for item 100 and return it.""" return load_fixture("plex/media_100.xml")
Load media payload for item 200 and return it.
def media_200_fixture(): """Load media payload for item 200 and return it.""" return load_fixture("plex/media_200.xml")
Load resources payload for a Plex Web player and return it.
def player_plexweb_resources_fixture(): """Load resources payload for a Plex Web player and return it.""" return load_fixture("plex/player_plexweb_resources.xml")
Load resources payload for a Plex HTPC player and return it.
def player_plexhtpc_resources_fixture(): """Load resources payload for a Plex HTPC player and return it.""" return load_fixture("plex/player_plexhtpc_resources.xml")
Load payload for all playlists and return it.
def playlists_fixture(): """Load payload for all playlists and return it.""" return load_fixture("plex/playlists.xml")
Load payload for playlist 500 and return it.
def playlist_500_fixture(): """Load payload for playlist 500 and return it.""" return load_fixture("plex/playlist_500.xml")
Load payload for playqueue creation response and return it.
def playqueue_created_fixture(): """Load payload for playqueue creation response and return it.""" return load_fixture("plex/playqueue_created.xml")