How to use test_None method in tempest

Best Python code snippet using tempest_python

appsettings.py

Source:appsettings.py Github

copy

Full Screen

1import sys2from enum import Enum3# [Number, Description, FailureType, Enable, Checked, Result]4import shared5useDesktopToSaveReports = True6useDongle = True7useMac = True8'''9esto sera de manera general10useHostname = list() #lee el archivo de serverConfig11usePort = list()12usePassw = list()13'''14#para prueba15useIp = list() #'192.168.1.73' #es probable que sea una lista tambien16usePort = 9000 #para todos17measureWMVoltage = False18jlinkSNforPIC32 = 82010085419jlinkSNforNRF52 = 82010085420inAustin = False21remoteDebug = True22TEST_UNCHECKED = 023TEST_CHECKED = 124NON_CATASTROPHIC = 025CATASTROPHIC = 126BARCODE_SCANNED = False27TESTFIXTURE_CLOSED = False28EXCLUDE = 029INCLUDE = 130TEST_PASS = 031TEST_FAIL = 132TEST_NONE = 233TEST_ABORTED = 3 # ABORTED BY OPEN LID OR DUT REMOVED34TEST_CANCEL = 4 # TEST CANCELED BY THE USER35GLOBAL_NUMBER_OF_TESTS = 036GLOBAL_CURRENT_TEST = 037GLOBAL_TEST_RESULT = TEST_NONE38GLOBAL_TEST_STATUS = TEST_NONE39CURRENT_SERIAL_NUMBER = None40#GLOBAL_ROOT_PASWORD = 'Paulina84'41if inAustin:42 GLOBAL_ROOT_PASWORD = 'vwtele123'43else:44 GLOBAL_ROOT_PASWORD = 'Paulina84'45'''46APP_TESTS = [47 ['ActivatingManufacturingTestingOnThePIC32AndNRF52', 'Activating Manufacturing Testing on the PIC32 and NRF52', CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],48 ['nRF52BLETest', 'nRF52 BLE Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE]49]50'''51APP_TESTS = [52 ['boardCurrentTest', 'Board Current Test', CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],53 ['voltageTestsPart1', 'Voltage Tests Part 1', CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],54 ['nRF52SiliconVersionandSerialNumberVerification', 'nRF52 Silicon Version and Serial Number Verification', CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],55 ['nRF52ManufacturingFirmwareProgram', 'nRF52 Manufacturing Firmware Program', CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],56 ['PIC32SiliconVersionVerification', 'PIC32 Silicon Version Verification', CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],57 ['PIC32ManufacturingFirmwareProgramming', 'PIC32 Manufacturing Firmware Programming', CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],58 ['ActivatingManufacturingTestingOnThePIC32AndNRF52', 'Activating Manufacturing Testing on the PIC32 and NRF52', CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],59 ['voltageTestsPart2', 'Voltage Tests Part 2', CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],60 ['hardwareIDTest', 'Hardware ID Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],61 ['pic32SetSerialNumber', 'PIC32 Set Serial Number', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],62 ['PIC32ReadFirmwareVersions', 'PIC32 Read Firmware Versions', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],63 ['NRF52ReadFirmwareVersions', 'NRF52 Read Firmware Versions', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],64 ['nRF52BLETest', 'nRF52 BLE Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],65 ['nRF52ExpansionPortPowerTest', 'nRF52 Expansion Port Power Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],66 ['nRF52ExpansionPortCommunicationTest', 'nRF52 Expansion Port Communication Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],67 ['nRF52AccelerometerTest', 'nRF52 Accelerometer Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],68 ['nRF52SerialEEPROMTest', 'nRF52 Serial EEPROM Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],69 ['PIC32SerialFlashTest', 'PIC32 Serial Flash Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],70 ['PIC32EEPROMTest', 'PIC32 EEPROM Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],71 ['PIC32_to_nRF52_SPIInterfaceTest', 'PIC32-to-nRF52 SPI Interface Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],72 ['PIC32_to_nRF52_GPIOPinsTest', 'PIC32-to-nRF52 GPIO Pins', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],73 ['PIC32MDBInterfaceTest', 'PIC32 MDB Interface Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],74 ['PIC32DEXInterfaceTest', 'PIC32 DEX Interface Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],75 ['CreditCardReaderInterfaceCommunicationTest', 'Credit Card Reader Interface Communication Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],76 ['CreditCardReaderInterfacePowerTest', 'Credit Card Reader Interface Power Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],77 ['IDSNormallyClosedSwitchTest', 'IDS Normally Closed Switch Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],78 ['IDSNormallyOpenSwitchTest', 'IDS Normally Open Switch Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],79 ['SDSSwitchTest', 'SDS Switch Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],80 ['IDSForceTest', 'IDS Force Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],81 ['USBDataTest', 'USB Data Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],82 ['USBPortChargingTest', 'USB Charging Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],83 ['WirelessModuleInterfacePIC32SPITest', 'Wireless Module Interface PIC32 SPI Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],84 ['WirelessModuleInterfacePIC32GPIOTest', 'Wireless Module Interface PIC32 GPIO Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],85 ['WirelessModuleInterfacePIC32UARTTest', 'Wireless Module Interface PIC32 UART Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],86 ['WirelessModuleInterfacenRF52I2CTest', 'Wireless Module Interface nRF52 I2C Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],87 ['WirelessModuleInterfacenRF52GPIOTest', 'Wireless Module Interface nRF52 GPIO Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],88 ['FrontPanelPowerStatusLEDTest', 'Front Panel Power Status LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],89 #['FrontPanelWirelessModuleStatusLEDTest', 'Front Panel Wireless Module Status LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],90 ['FrontPanelTriColorStatusBLUELEDTest', 'Front Panel Tri-Color Status BLUE LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],91 ['FrontPanelTriColorStatusREDLEDTest', 'Front Panel Tri-Color Status RED LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],92 ['FrontPanelTriColorStatusGREENLEDTest', 'Front Panel Tri-Color Status GREEN LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],93 ['RefillSwitchTest', 'Refill Switch Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],94 ['PIC32ResetTest', 'PIC32 Reset Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],95 ['nRF52ResetTest', 'nRF52 Reset Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],96 ['BatteryTest', 'Battery Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],97 ['BatteryBoostCircuitandMainVoltageLossIndicatorCircuitTest', 'Battery Boost Circuit and Main Voltage Loss Indicator Circuit Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],98 ['PIC32ApplicationFirmwareProgramming', 'Set As Application Firmware', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],99 ]100'''101APP_TESTS = [102 ['FrontPanelPowerStatusLEDTest', 'Front Panel Power Status LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],103 #['FrontPanelWirelessModuleStatusLEDTest', 'Front Panel Wireless Module Status LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],104 ['FrontPanelTriColorStatusBLUELEDTest', 'Front Panel Tri-Color Status BLUE LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],105 ['FrontPanelTriColorStatusREDLEDTest', 'Front Panel Tri-Color Status RED LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE],106 ['FrontPanelTriColorStatusGREENLEDTest', 'Front Panel Tri-Color Status GREEN LED Test', NON_CATASTROPHIC, INCLUDE, TEST_UNCHECKED, TEST_NONE]107]108'''109def getDescriptionFromNumber(number):110 for x in range(0, len(APP_TESTS)):111 if APP_TESTS[x][0] == number:112 return APP_TESTS[x][1]113def getNumberFromDescription(description):114 for x in range(0, len(APP_TESTS)):115 if APP_TESTS[x][1] == description:116 return APP_TESTS[x][0]117def getFailureTypeFromDescription(description):118 for x in range(0, len(APP_TESTS)):119 if APP_TESTS[x][1] == description:120 return APP_TESTS[x][2]121def getEnableStateFromDescription(description):122 for x in range(0, len(APP_TESTS)):123 if APP_TESTS[x][1] == description:124 return APP_TESTS[x][3]125def getCheckedStateFromDescription(description):126 for x in range(0, len(APP_TESTS)):127 if APP_TESTS[x][1] == description:128 return APP_TESTS[x][4]129def setCheckedStateFromDescription(description, state):130 for x in range(0, len(APP_TESTS)):131 if APP_TESTS[x][1] == description:132 APP_TESTS[x][4] = state133def getTestStatusFromDescription(description):134 for x in range(0, len(APP_TESTS)):135 if APP_TESTS[x][1] == description:136 return APP_TESTS[x][5]137def setTestStatusFromDescription(description, status):138 for x in range(0, len(APP_TESTS)):139 if APP_TESTS[x][1] == description:140 APP_TESTS[x][5] = status141def countEnabledTests():142 counter = 0143 for x in range(0, len(APP_TESTS)):144 if APP_TESTS[x][3] == INCLUDE:145 counter = counter + 1146 return counter147#######################################################################################################148# Future Technology Devices International Limited FT232R USB UART149FTDI_idVendor=0x0403150FTDI_idProduct=0x6001151FTDI_baudRate=115200152if inAustin == True:153 FTDI_serialNumber='AH05R7EI' # Austin154else:155 FTDI_serialNumber='AH05R7EG' # Monterrey156if inAustin == True:157 lj_sn1 = 320074622158 lj_sn2 = 320084481159else:160 lj_sn1 = 320080921161 lj_sn2 = 320080921162# Honeywell BarcodeScanner 0c2e163BarcodeScanner_idVendor=0x0c2e164BarcodeScanner_idProduct=0x0b6a165BarcodeScanner_baudRate=115200166BarcodeScanner_endChar='\r'167# LabJack U3 LV 0cd5 LabJack U3168LabJack_idVendor=0x0cd5169LabJack_idProduct=0x0003170# Winbond Electronics Corp. USB Virtual COM171KORAD_idVendor=0x0416172KORAD_idProduct=0x5011173KORAD_baudRate=9600174# PIC32 ICSP SPEED175PIC32_SEGGER_SPEED = 20000176# NRF52 SWD SPEED177NRF52_SEGGER_SPEED = 4000178#######################################################################################################179LED_THRESHOLD = 80180# MDB Voltage and Current Test181MDB_VOLTAGE_HIGH_VALUE = 30182MDB_VOLTAGE_LOW_VALUE = 20183MDB_CURRENT_HIGH_VALUE = 200 # mA184MDB_CURRENT_LOW_VALUE = 25 # mA185# Voltage Tests [A2, A1, A0]186# VCC_MDB_FLTR, Filtered MDB input voltage (VCC_MDB_FLTR), TP38, [0, 0, 0]187VCC_MDB_FLTR_ACCEPTABLE_HIGH_VALUE = 25.2188VCC_MDB_FLTR_ACCEPTABLE_LOW_VALUE = 19.0189# VCC_5V0, Main 5.0 VDC supply output from SIC462ED (U11), TP15, [0, 0, 1]190VCC_5V0_HIGH_VALUE = 5.1191VCC_5V0_LOW_VALUE = 4.2192# VCC_5V0F, 5.0 VDC to PAM2310 (U8) TP14, [0, 1, 0]193VCC_5V0F_HIGH_VALUE = 5.1194VCC_5V0F_LOW_VALUE = 4.2195# VCC5V0F, 5.0 VDC at Wireless Module, TP16, [0, 1, 1]196VCC5V0F_HIGH_VALUE = 5.1197VCC5V0F_LOW_VALUE = 4.2198# VCC_3V3, Main 3.3 VDC supply output from PAM2310 (U8), TP13, [1, 0, 0]199VCC_3V3_HIGH_VALUE = 5.1200VCC_3V3_LOW_VALUE = 3.0201# VBUS, USB Charger 5.0 VDC, J8.1, [1, 0, 1]202VBUS_HIGH_VALUE = 5.1203VBUS_LOW_VALUE = 4.5204# VCC_5V0GPIO, Expansion Port 5.0 VDC, P1.1, [1, 1, 0]205VCC_5V0GPIO_HIGH_VALUE = 5.1206VCC_5V0GPIO_LOW_VALUE = 4.1207# VCC_FLT_MDB, Power Supply (U16) Card Reader 24.0 VDC, TP42, [1, 1, 1]208VCC_FLT_MDB_HIGH_VALUE = 25.2209VCC_FLT_MDB_LOW_VALUE = 17.5210# VCC3V3_WM, 3.3V VDC at Wireless Module, TP18,211VCC3V3_WM_HIGH_VALUE = 5.1212VCC3V3_WM_LOW_VALUE = 3.0213if __name__ == "__main__":...

Full Screen

Full Screen

test_dirty_setter.py

Source:test_dirty_setter.py Github

copy

Full Screen

1import unittest2from sickchill.tv import DirtySetter3class DirtySetterTests(unittest.TestCase):4 test_none = DirtySetter(None)5 test_bool = DirtySetter(False)6 def setUp(self) -> None:7 super().setUp()8 self.dirty = True9 def test_dirty_setter(self):10 assert self.dirty11 self.dirty = False12 self.assertIsNone(self.test_none)13 self.test_none = None14 assert not self.dirty15 self.test_none = 116 assert self.dirty17 self.assertIs(self.test_none, 1)18 assert self.dirty19 self.dirty = False20 self.test_none = None21 assert self.dirty22 self.assertIsNone(self.test_none)23 assert self.dirty24 self.dirty = False25 self.test_none = dict(one=1)26 assert self.dirty27 self.assertDictEqual(self.test_none, dict(one=1))28 assert self.dirty29 self.dirty = False30 self.test_none = [dict(one=1)]31 assert self.dirty32 self.assertListEqual(self.test_none, [dict(one=1)])33 assert self.dirty34 self.dirty = False35 self.test_none = "RANDOM"36 assert self.dirty37 assert self.test_none == "RANDOM"38 assert self.dirty39 self.dirty = False40 def test_dirty_setter_stays_dirty(self):41 assert self.dirty42 self.dirty = False43 assert not self.test_bool44 self.test_bool = True45 assert self.test_bool46 assert self.dirty47 self.test_bool = False48 assert not self.test_bool49 assert self.dirty50 self.test_bool = None51 self.assertIsNone(self.test_bool)...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful