Best Python code snippet using autotest_python
test_logs.py
Source:test_logs.py
...39 assert TEST_BOOT_IDS == await coresys.host.logs.get_boot_ids()40 # Boot ID query should not be run again, mock a failure for it to ensure41 journald_gateway.side_effect = TimeoutError()42 assert TEST_BOOT_IDS == await coresys.host.logs.get_boot_ids()43 assert "b1c386a144fd44db8f855d7e907256f8" == await coresys.host.logs.get_boot_id(0)44 # -1 is previous boot. We have 2 boots so -2 is too far45 assert "b2aca10d5ca54fb1b6fb35c85a0efca9" == await coresys.host.logs.get_boot_id(-1)46 with pytest.raises(ValueError):47 await coresys.host.logs.get_boot_id(-2)48 # 1 is oldest boot and count up from there. We have 2 boots so 3 is too far49 assert "b2aca10d5ca54fb1b6fb35c85a0efca9" == await coresys.host.logs.get_boot_id(1)50 assert "b1c386a144fd44db8f855d7e907256f8" == await coresys.host.logs.get_boot_id(2)51 with pytest.raises(ValueError):52 await coresys.host.logs.get_boot_id(3)53async def test_identifiers(coresys: CoreSys, journald_gateway: MagicMock):54 """Test getting identifiers."""55 journald_gateway.return_value.__aenter__.return_value.text = AsyncMock(56 return_value=load_fixture("logs_identifiers.txt")57 )58 # Mock is large so just look for a few different types of identifiers59 for identifier in [60 "addon_local_ssh",61 "hassio_dns",62 "hassio_supervisor",63 "kernel",64 "os-agent",65 ]:66 assert identifier in await coresys.host.logs.get_identifiers()
sqlite_libt0.6000000000000001_pp2.0_fp2.0_19.py
Source:sqlite_libt0.6000000000000001_pp2.0_fp2.0_19.py
1import ctypes2import ctypes.util3import threading4import sqlite35import datetime6import sys7import re8import subprocess9import logging10import time11import socket12import uuid13import platform14import os15import stat16import errno17import copy18import traceback19from . import rpc20from . import client21from . import utils22from . import bsd23from . import fsevents24from . import hash25from . import metadata26from . import __version__27from .utils import (28 get_platform,29 get_cpu_arch,30 get_os_version,31 get_machine_id,32 get_hostname,33 get_user_name,34 get_rsync_version,35 get_ssh_version,36 get_python_version,37 get_system_uuid,38 get_boot_id,39 get_fqdn,40 get_kernel_version,41 get_kernel_name,42 get_kernel_release,43 get_kernel_version_tuple,44 get_kernel_release_tuple,...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!