def test_xauth_update(self): """Test overwriting an xauth entry""" yield from update_xauth(asyncio.get_event_loop(), "xauth", "test", "0", b"", b"\x00") yield from update_xauth(asyncio.get_event_loop(), "xauth", "test", "0", b"", b"\x01") self.assertEqual(len(list(walk_xauth("xauth"))), 1) _, auth_data = yield from lookup_xauth(asyncio.get_event_loop(), "xauth", "test", "0") os.unlink("xauth") self.assertEqual(auth_data, b"\x01")
def test_xauth_update(self): """Test overwriting an xauth entry""" yield from update_xauth(asyncio.get_event_loop(), 'xauth', 'test', '0', b'', b'\x00') yield from update_xauth(asyncio.get_event_loop(), 'xauth', 'test', '0', b'', b'\x01') self.assertEqual(len(list(walk_xauth('xauth'))), 1) _, auth_data = yield from lookup_xauth(asyncio.get_event_loop(), 'xauth', 'test', '0') os.unlink('xauth') self.assertEqual(auth_data, b'\x01')
def test_xauth_lookup(self): """Test writing an xauth entry and looking it back up""" yield from update_xauth(asyncio.get_event_loop(), "xauth", "test", "0", b"", b"\x00") _, auth_data = yield from lookup_xauth(asyncio.get_event_loop(), "xauth", "test", "0") os.unlink("xauth") self.assertEqual(auth_data, b"\x00")
def test_xauth_lookup(self): """Test writing an xauth entry and looking it back up""" yield from update_xauth(asyncio.get_event_loop(), 'xauth', 'test', '0', b'', b'\x00') _, auth_data = yield from lookup_xauth(asyncio.get_event_loop(), 'xauth', 'test', '0') os.unlink('xauth') self.assertEqual(auth_data, b'\x00')
def test_xauth_dead_lock(self): """Test removal of dead Xauthority lock""" with open("xauth-c", "w"): pass yield from asyncio.sleep(6) yield from update_xauth(asyncio.get_event_loop(), "xauth", "test", "0", b"", b"\x00") _, auth_data = yield from lookup_xauth(asyncio.get_event_loop(), "xauth", "test", "0") os.unlink("xauth") self.assertEqual(auth_data, b"\x00")
def test_xauth_dead_lock(self): """Test removal of dead Xauthority lock""" with open('xauth-c', 'w'): pass yield from asyncio.sleep(6) yield from update_xauth(asyncio.get_event_loop(), 'xauth', 'test', '0', b'', b'\x00') _, auth_data = yield from lookup_xauth(asyncio.get_event_loop(), 'xauth', 'test', '0') os.unlink('xauth') self.assertEqual(auth_data, b'\x00')