def test_root_interface_properties(self, popen, sleep, isfile, killpg, atexit, command_name, property_name, command_args, expected_dbus_call_args): self.patch_and_run_omxplayer() self.player._root_interface.dbus_interface = "org.mpris.MediaPlayer2" interface = self.player._properties_interface interface.reset_mock() self.patch_interface_and_run_command(command_name, command_args) expected_call = call.Get("org.mpris.MediaPlayer2", property_name, *expected_dbus_call_args) interface.assert_has_calls([expected_call])
def test_player_interface_properties(self, popen, sleep, isfile, killpg, atexit, command_name, property_name, expected_result, property_result): interface_address = "org.mpris.MediaPlayer2" self.patch_and_run_omxplayer() self.player._root_interface.dbus_interface = interface_address interface = self.player._properties_interface interface.reset_mock() mock = interface.Get mock.configure_mock(return_value=property_result) result = self.patch_interface_and_run_command(command_name, []) interface.assert_has_calls([(call.Get(interface_address, property_name))]) self.assertEqual(expected_result, result)