How to use _total method in yandex-tank

Best Python code snippet using yandex-tank

layouts.py

Source:layouts.py Github

copy

Full Screen

...8from dossiers2.custom import layouts as com_layouts, records9_AB = achievements.ACHIEVEMENT_BLOCK10def _7x7(achieveName):11 return (_AB.TEAM_7X7, achieveName)12def _total(achieveName):13 return (_AB.TOTAL, achieveName)14def _single(achieveName):15 return (_AB.SINGLE, achieveName)16def _single7x7(achieveName):17 return (_AB.SINGLE_7X7, achieveName)18def _fallout(achieveName):19 return (_AB.FALLOUT, achieveName)20def _epicBattle(achieveName):21 return (_AB.EPIC_BATTLE, achieveName)22_TANK_EXPERT_PREFIX = 'tankExpert'23_MECH_ENGINEER_PREFIX = 'mechanicEngineer'24_VEHICLE_COLLECTOR_PREFIX = 'collectorVehicle'25_HIST_BATTLEFIELD_POSTFIX = 'battlefield'26TANK_EXPERT_GROUP = [_total(_TANK_EXPERT_PREFIX)]27MECH_ENGINEER_GROUP = [_total(_MECH_ENGINEER_PREFIX)]28VEHICLE_COLLECTOR_GROUP = [_total(_VEHICLE_COLLECTOR_PREFIX)]29for _nID, name in enumerate(nations.AVAILABLE_NAMES):30 TANK_EXPERT_GROUP.append(_total('%s%d' % (_TANK_EXPERT_PREFIX, _nID)))31 MECH_ENGINEER_GROUP.append(_total('%s%d' % (_MECH_ENGINEER_PREFIX, _nID)))32 VEHICLE_COLLECTOR_GROUP.append(_total('%s%d' % (_VEHICLE_COLLECTOR_PREFIX, _nID)))33HISTORY_BATTLEFIELD_GROUP = []34PERSONAL_MISSIONS_GROUP = [_single('firstMerit'),35 _total('readyForBattleLT'),36 _total('readyForBattleMT'),37 _total('readyForBattleSPG'),38 _total('readyForBattleATSPG'),39 _total('readyForBattleALL'),40 _total('tankwomenProgress'),41 _total('readyForBattleAllianceUSSR'),42 _total('readyForBattleAllianceGermany'),43 _total('readyForBattleAllianceUSA'),44 _total('readyForBattleAllianceFrance'),45 _single('newMeritPM2'),46 _single('mapboxSeason1'),47 _single('mapboxSeason2'),48 _single('mapboxSeason3'),49 _total('mapboxUniversal')]50CHRISTMAS_QUESTS_GROUP = [_single('xmasTreeBronze'), _single('xmasTreeSilver'), _single('xmasTreeGold')]51HE17_QUESTS_GROUP = [_single('HE17A1'), _single('HE17A2'), _single('HE17A3')]52NY18_QUESTS_GROUP = [_single('NY18A1'), _single('NY18A2'), _single('NY18A3')]53IGNORED_BY_BATTLE_RESULTS = [achievements.MARK_OF_MASTERY_RECORD, _single7x7('victoryMarch')]54for record in records.RECORD_DB_IDS:55 if record[1] in ('maxXP', 'maxFrags', 'maxDamage', 'maxWinPoints', 'maxCoins'):56 IGNORED_BY_BATTLE_RESULTS.append(record)57_COMMON_DOSSIERS_TYPE = 058_EXCLUDED_ACHIEVES = defaultdict(tuple, {})59_CUSTOM_ACHIEVES = defaultdict(tuple, {})60def _getComLayoutRecordID(record):61 if record in TANK_EXPERT_GROUP:62 return (record[0], 'tankExpertStrg')63 if record in MECH_ENGINEER_GROUP:64 return (record[0], 'mechanicEngineerStrg')65 return (record[0], 'collectorVehicleStrg') if record in VEHICLE_COLLECTOR_GROUP else record66def _buildComLayoutSet(dossierType, comLayout):67 global _EXCLUDED_ACHIEVES68 result = set()69 for layout in comLayout:70 if hasattr(layout, 'recordsLayout'):71 result.update(set(((layout.name, r) for r in layout.recordsLayout)))72 result.add(achievements.makeAchievesStorageName(layout.name))73 for dt in (_COMMON_DOSSIERS_TYPE, dossierType):74 result -= set(_EXCLUDED_ACHIEVES[dt])75 result |= set(_CUSTOM_ACHIEVES[dt])76 return result77ACCOUNT_ACHIEVEMENT_LAYOUT = []78VEHICLE_ACHIEVEMENT_LAYOUT = []79TANKMAN_ACHIEVEMENT_LAYOUT = []80FORT_ACHIEVEMENT_LAYOUT = []81RATED7x7_ACHIEVEMENT_LAYOUT = []82CLUB_ACHIEVEMENT_LAYOUT = []83_layoutsMap = {}84def getAchievementsLayout(dossierType):85 global _layoutsMap86 return _layoutsMap[dossierType][0] if dossierType in _layoutsMap else tuple()87def isAchievementRegistered(record):88 return record in achievements.ACHIEVEMENTS89_MODE_ACHIEVEMENTS = defaultdict(set)90def getAchievementsByMode(mode):91 result = set()92 for modeID, achieves in _MODE_ACHIEVEMENTS.iteritems():93 if mode & modeID:94 result |= achieves95 return result96NEAREST_ACHIEVEMENTS = TANK_EXPERT_GROUP + MECH_ENGINEER_GROUP + VEHICLE_COLLECTOR_GROUP + [_total('mousebane'),97 _total('beasthunter'),98 _total('pattonValley'),99 _total('sinai'),100 _total('medalKnispel'),101 _total('medalCarius'),102 _total('medalAbrams'),103 _total('medalPoppel'),104 _total('medalKay'),105 _total('medalEkins'),106 _total('medalLeClerc'),107 _total('medalLavrinenko'),108 _total('readyForBattleLT'),109 _total('readyForBattleMT'),110 _total('readyForBattleHT'),111 _total('readyForBattleSPG'),112 _total('readyForBattleATSPG'),113 _7x7('geniusForWarMedal'),114 _7x7('wolfAmongSheepMedal'),115 _7x7('fightingReconnaissanceMedal'),116 _7x7('crucialShotMedal'),117 _7x7('forTacticalOperations'),118 _total('readyForBattleAllianceUSSR'),119 _total('readyForBattleAllianceGermany'),120 _total('readyForBattleAllianceUSA'),121 _total('readyForBattleAllianceFrance'),122 _total('rankedDivisionFighter'),123 _total('rankedStayingPower')]124def init():125 global _EXCLUDED_ACHIEVES126 global _layoutsMap127 global HISTORY_BATTLEFIELD_GROUP128 HISTORY_BATTLEFIELD_GROUP = [ _r for _r in achievements.ACHIEVEMENTS if str(_r[1]).endswith(_HIST_BATTLEFIELD_POSTFIX) ]129 _EXCLUDED_ACHIEVES = defaultdict(tuple, {_COMMON_DOSSIERS_TYPE: (achievements.MARK_OF_MASTERY_RECORD, achievements.MARK_ON_GUN_RECORD),130 DOSSIER_TYPE.VEHICLE: tuple((r for r, v in achievements.ACHIEVEMENTS.iteritems() if v['section'] == achievements.ACHIEVEMENT_TYPE.CLASS)) + (_7x7('wolfAmongSheepMedal'),131 _7x7('geniusForWarMedal'),132 _7x7('fightingReconnaissanceMedal'),133 _7x7('crucialShotMedal'),134 _7x7('forTacticalOperations'),135 _7x7('promisingFighterMedal'),136 _7x7('heavyFireMedal'),137 _7x7('rangerMedal'),...

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 yandex-tank 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