How to use rm method in pytest-mock

Best Python code snippet using pytest-mock

TimelineItemRenderer-dbg.js

Source:TimelineItemRenderer-dbg.js Github

copy

Full Screen

1/*!2 * SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2013 SAP AG. All rights reserved3 */4 5 6jQuery.sap.declare("sap.suite.ui.commons.TimelineItemRenderer");7jQuery.sap.require("sap.ui.core.Renderer");8/**9 * @class TimelineItem renderer. 10 * @static11 */12sap.suite.ui.commons.TimelineItemRenderer = {13};14/**15 * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.16 * 17 * @param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer18 * @param {sap.ui.core.Control} oControl an object representation of the control that should be rendered19 */20 21 sap.suite.ui.commons.TimelineItemRenderer.render = function(oRm, oControl) {22 if (oControl._orientation === "V") {23 this.renderLIContentV(oRm, oControl);24 } else {25 this.renderLIContentH(oRm, oControl);26 }27};28 29sap.suite.ui.commons.TimelineItemRenderer.renderLIContentH = function(oRm, oLI) {30 oRm.write("<li ");31 oRm.writeAttribute("role", "option");32 oRm.addClass("sapSuiteUiCommonsTimelineItemLiWrapperV");33 oRm.writeClasses();34 oRm.write(">");35 oRm.write("<div ");36 oRm.addClass("sapSuiteUiCommonsTimelineItemWrapperV");37 oRm.writeClasses();38 oRm.write(">");39 oRm.write("<div ");40 oRm.addClass("sapSuiteUiCommonsTimelineItemBarV");41 oRm.writeClasses();42 oRm.write(">");43 oRm.write("</div>");44 if (oLI._showIcons) {45 oRm.write("<div ");46 oRm.addClass("sapSuiteUiCommonsTimelineItemNoIcon");47 oRm.writeClasses();48 oRm.write(">");49 oRm.write("</div>");50 } else {51 oRm.renderControl(oLI._getImageControl());52 }53 oRm.write("<div ");54 oRm.addClass("sapSuiteUiCommonsTimelineItemBubbleSpacerV");55 oRm.writeClasses();56 oRm.write(">");57 oRm.write("<div ");58 oRm.addClass("sapSuiteUiCommonsTimelineItemBubble");59 oRm.writeClasses();60 oRm.write(">");61 62 oRm.write("<div ");63 oRm.addClass("sapSuiteUiCommonsTimelineItemArrow");64 oRm.writeClasses();65 oRm.write(">");66 oRm.write("</div>");67 oRm.write("<div ");68 oRm.addClass("sapSuiteUiCommonsTimelineItemBox");69 oRm.writeClasses();70 oRm.write(">");71 if (this.renderItemShell) {72 this.renderItemShell(oRm, oLI);73 }74 oRm.write("</div>"); // close box75 oRm.write("</div>"); // close bubble76 oRm.write("</div>"); // close spacer77 oRm.write("</div>");78 oRm.write("</li>");79};80sap.suite.ui.commons.TimelineItemRenderer.renderLIContentV = function(oRm, oLI) {81 oRm.write("<li ");82 oRm.writeAttribute("role", "option");83 oRm.writeControlData(oLI);84 oRm.addClass("sapSuiteUiCommonsTimelineItem");85 oRm.writeClasses();86 oRm.write(">");87 oRm.write("<div ");88 oRm.addClass("sapSuiteUiCommonsTimelineItemWrapper");89 oRm.writeClasses();90 oRm.write(">");91 oRm.write("<div ");92// if (oLI.getPosition() == sap.suite.ui.commons.TimelineItemPosition.Bottom) {93 if (oLI._position == sap.suite.ui.commons.TimelineItemPosition.Bottom) {94 oRm.addClass("sapSuiteUiCommonsTimelineItemBarBottom");//TODO : check if you really need this..95 } else {96 oRm.addClass("sapSuiteUiCommonsTimelineItemBar");97 }98 oRm.writeClasses();99 oRm.write(">");100 oRm.write("</div>");101 if (oLI._showIcons){102 oRm.write("<div ");103 oRm.addClass("sapSuiteUiCommonsTimelineItemNoIcon");104 oRm.writeClasses();105 oRm.write(">");106 oRm.write("</div>");107 } else {108 oRm.renderControl(oLI._getImageControl());109 }110 oRm.write("<div ");111 oRm.addClass("sapSuiteUiCommonsTimelineItemBubbleSpacer");112 113 oRm.addClass("sapSuiteUiCommonsTimelineItemBubbleSpacerLeft"); //arrow on the left.. get it dynamically.114// if (oLI.getPosition() == sap.suite.ui.commons.TimelineItemPosition.Bottom) {115 if (oLI._position == sap.suite.ui.commons.TimelineItemPosition.Bottom) {116 oRm.addClass("sapSuiteUiCommonsTimelineItemBubbleSpacerBottom");117 }118 119 oRm.writeClasses();120 oRm.write(">");121 122 oRm.write("<div ");123 oRm.addClass("sapSuiteUiCommonsTimelineItemBubble");124// oRm.writeAttribute("tabindex", "-1");125 oRm.writeClasses();126 oRm.write(">");127 oRm.write("<div ");128 oRm.addClass("sapSuiteUiCommonsTimelineItemArrow");129 oRm.writeClasses();130 oRm.write(">");131 oRm.write("</div>");132 oRm.write("<div ");133 oRm.addClass("sapSuiteUiCommonsTimelineItemBox");134 oRm.writeClasses();135 oRm.write(">");136 if (this.renderItemShell) {137 this.renderItemShell(oRm, oLI);138 }139 oRm.write("</div>"); // close box140 oRm.write("</div>"); // close bubble141 oRm.write("</div>"); // close spacer142 oRm.write("</div>");143 144 oRm.write("</li>");145};146 147 sap.suite.ui.commons.TimelineItemRenderer._writeCollapsedText = function(rm, oControl, sMyId) {148 // 'oFeedListItem._bTextExpanded' is true if the text had been expanded and rendering needs to be done again.149 if (oControl._bTextExpanded) {150 rm.writeEscaped(oControl._sFullText, true);151 rm.write('</span>');152 rm.write('<span id="' + sMyId + '-threeDots" class ="sapMFeedListItemTextString">');153 rm.write("&#32"); // space154 rm.write('</span>');155 } else {156 rm.writeEscaped(oControl._getCollapsedText(), true);157 rm.write('</span>');158 rm.write('<span id="' + sMyId + '-threeDots" class ="sapMFeedListItemTextString">');159 rm.write("&#32&#46&#46&#46&#32"); // space + three dots + space160 rm.write('</span>');161 }162 var oLinkExpandCollapse = oControl._getLinkExpandCollapse();163 oLinkExpandCollapse.addStyleClass("sapMFeedListItemLinkExpandCollapse");164 rm.renderControl(oLinkExpandCollapse);165 };166 167 168sap.suite.ui.commons.TimelineItemRenderer.renderItemShell = function(oRm, oControl){ 169 oRm.write("<div");170// oRm.writeControlData(oControl);171 oRm.writeAttribute("id", oControl.getId() + "-shell");172 oRm.addClass("sapSuiteUiCommonsTimelineItemShell");173 oRm.writeAttribute("tabindex", "-1");174 oRm.writeClasses();175 oRm.write(">"); 176 oRm.renderControl(oControl._replyInfoBar);177 178 if (oControl.getUserPicture()) {179 oRm.write("<div");180 oRm.writeAttribute("id", oControl.getId() + "-userpicture");181 oRm.addClass("sapSuiteUiCommonsTimelineItemUserPicture");182 oRm.writeClasses();183 oRm.write(">");184 oRm.renderControl(oControl._getUserPictureControl());185 oRm.write("</div>");186 }187 oRm.write("<div");188 oRm.writeAttribute("title", jQuery.sap.encodeHTML(oControl.getUserName()) + " " + jQuery.sap.encodeHTML(oControl.getTitle()));189 //added yy190 oRm.writeAttribute("id", oControl.getId() + "-header");191 oRm.addClass("sapSuiteUiCommonsTimelineItemHeader");192 oRm.addClass("sapSuiteUiCommonsTimelineItemTextLineClamp");193 oRm.addStyle("-webkit-line-clamp", 2);194 oRm.writeClasses();195 oRm.writeStyles();196 //oRm.writeControlData(oControl);197 oRm.write(">");198 oRm.write("<span");199 //oRm.writeControlData(oControl);200 oRm.writeAttribute("id", oControl.getId() + "-username");201 oRm.addClass("sapSuiteUiCommonsTimelineItemShellUser");202 oRm.writeClasses();203 oRm.write(">"); 204 if (oControl.getUserNameClickable()) {205 oControl._userNameLink.setText(oControl.getUserName());206 oControl._userNameLink.setTooltip(oControl.getUserName());207 oRm.renderControl(oControl._userNameLink);208 } else {209 oRm.writeEscaped(oControl.getUserName());210 }211 oRm.write("</span>");212 213 oRm.write("<span");214 //oRm.writeControlData(oControl);215 oRm.addClass("sapSuiteUiCommonsTimelineItemShellHdr");216 oRm.writeClasses();217 oRm.write(">"); 218 oRm.writeEscaped(" " + oControl.getTitle());219 oRm.write("</span>");220 221 oRm.write("</div>");222 223 oRm.write("<div");224 //oRm.writeControlData(oControl);225 oRm.addClass("sapSuiteUiCommonsTimelineItemShellDateTime");226 oRm.writeClasses();227 oRm.write(">"); 228 oRm.writeEscaped( oControl._formatDateValue( oControl.getDateTime() ) );229 oRm.write("</div>");230 231 oRm.write("<div");232 //oRm.writeControlData(oControl); 233 oRm.addClass("sapSuiteUiCommonsTimelineItemShellBody");234 // oRm.writeAttribute("id", oControl.getId() + "-sapSuiteUiCommonsTimelineItemShellBody");235 oRm.writeClasses();236 oRm.write(">"); 237 if (oControl.getEmbeddedControl() !== null ) {238 oRm.renderControl(oControl.getEmbeddedControl());239 } else {240 //oRm.writeEscaped(oControl.getText());241 if(oControl._textBox) {242 // oRm.renderControl(oControl._textBox);243 oRm.write('<span id="' + oControl.getId() + '-realtext">');244 if (!!oControl._checkTextIsExpandable()) {245 this._writeCollapsedText(oRm, oControl, oControl.getId());246 } else {247 oRm.writeEscaped(oControl._textBox);248 }249 250 251 252 }253 }254 oRm.write("</div>");255 256 // here we should do the bottom bar 257 if (oControl.getParent() && oControl.getParent()._aFilterList && (oControl.getParent().getEnableSocial() || oControl.getCustomAction().length > 0)) { //Check if there is Timeline as parent258 oRm.write("<div");259 oRm.addClass("sapSuiteUiCommonsTimelineItemShellBottom");260 oRm.writeClasses();261 oRm.write(">");262 oRm.renderControl(oControl._jamBar); 263 oRm.write("</div>"); 264 }265 oRm.write("</div>");...

Full Screen

Full Screen

NoteTakerFeederRenderer-dbg.js

Source:NoteTakerFeederRenderer-dbg.js Github

copy

Full Screen

1/*!2 * SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2013 SAP AG. All rights reserved3 */4jQuery.sap.declare("sap.suite.ui.commons.NoteTakerFeederRenderer");5/**6 * @class NoteTakerFeeder renderer. 7 * @static8 */9sap.suite.ui.commons.NoteTakerFeederRenderer = {10};11/**12 * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.13 * 14 * @param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer15 * @param {sap.ui.core.Control} oControl an object representation of the control that should be rendered16 */17sap.suite.ui.commons.NoteTakerFeederRenderer.render = function(oRm, oControl){18 var sTooltip = oControl.getTooltip_AsString();19 oRm.write("<div");20 oRm.writeControlData(oControl);21 if (sTooltip) {22 oRm.writeAttributeEscaped("title", sTooltip);23 }24 oRm.addClass("sapSuiteUiCommonsNoteTakerFeeder");25 oRm.writeClasses();26 oRm.writeAccessibilityState(oControl, {27 role : 'region',28 describedby : oControl.getId() + "-header"29 });30 oRm.write(">");31 //write header32 oRm.write("<div");33 oRm.writeAttribute("id", oControl.getId() + "-header");34 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederHeader");35 oRm.writeClasses();36 oRm.write(">");37 oRm.write("<div");38 oRm.writeAttribute("id", oControl.getId() + "-header-text");39 oRm.writeAccessibilityState(oControl, {40 role : 'heading'41 });42 oRm.write(">");43 oRm.writeEscaped(oControl._rb.getText("NOTETAKERFEEDER_TITLE"));44 oRm.write("</div>");45 oRm.write("</div>");46 //write tag panel47 oRm.write("<div");48 oRm.writeAttribute("id", oControl.getId() + "-tag-panel");49 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederTagPanel");50 oRm.writeClasses();51 oRm.write(">");52 oRm.write("<div");53 oRm.writeAttribute("id", oControl.getId() + "-left-toolbar");54 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederLeftPanel");55 oRm.writeClasses();56 oRm.write(">");57 oRm.renderControl(oControl._oTagButton);58 oRm.write("</div>");59 oRm.write("<div");60 oRm.writeAttribute("id", oControl.getId() + "-right-toolbar");61 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederRightPanel");62 oRm.writeClasses();63 oRm.write(">");64 oRm.renderControl(oControl._oThumbUpButton);65 oRm.renderControl(oControl._oThumbDownButton);66 oRm.renderControl(oControl._oAddAttachButton);67 oRm.renderControl(oControl._oFileUploader);68 oRm.write("</div>");69 oRm.write("</div>");70 //write attachment panel71 oRm.write("<div");72 oRm.writeAttribute("id", oControl.getId() + "-attachment-panel");73 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederAttachmentPanel");74 oRm.writeClasses();75 oRm.write(">");76 oRm.write("<div");77 oRm.writeAttribute("id", oControl.getId() + "-attachment-content");78 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederAttachmentContent");79 oRm.writeClasses();80 oRm.write(">");81 oRm.write("<div");82 oRm.writeAttribute("id", oControl.getId() + "-attachment-name");83 oRm.addClass("sapSuiteUiCommonsNtfAttachmentNamelbl");84 oRm.writeClasses();85 oRm.write(">");86 oRm.write("<div");87 oRm.writeAttribute("id", oControl.getId() + "-attachment-image");88 oRm.addClass("sapSuiteUiCommonsNtfAttachImg");89 oRm.writeClasses();90 oRm.write("/>");91 oRm.renderControl(oControl._oAttachmentLink);92 oRm.write("</div>"); 93 94 oRm.write("<div");95 oRm.writeAttribute("id", oControl.getId() + "-attachment-loading");96 oRm.addClass("sapSuiteUiCommonsNtfLoadingLbl");97 oRm.writeClasses();98 oRm.write(">");99 oRm.renderControl(oControl._oAttachmentLoadingLabel);100 oRm.write("</div>");101 102 oRm.write("<div");103 oRm.writeAttribute("id", oControl.getId() + "-attachment-delete");104 oRm.addClass("sapSuiteUiCommonsNtfDeleteBtn");105 oRm.writeClasses();106 oRm.write(">");107 oRm.renderControl(oControl._oDeleteAttachButton);108 oRm.write("</div>");109 oRm.write("</div>"); 110 oRm.write("</div>");111 112 //write title panel113 oRm.write("<div");114 oRm.writeAttribute("id", oControl.getId() + "-title-panel");115 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederTitlePanel");116 oRm.writeClasses();117 oRm.write(">");118 oRm.renderControl(oControl._oTitle);119 oRm.write("</div>");120 //write body121 oRm.write("<div");122 oRm.writeAttribute("id", oControl.getId() + "-body");123 if(oControl._oAddAttachButton.getEnabled()) {124 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederBody"); 125 } else {126 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederBodySmaller");127 }128 oRm.writeClasses();129 oRm.write(">");130 oRm.renderControl(oControl._oRequiredLbl);131 oRm.renderControl(oControl._oBody);132 oRm.write("</div>");133 oRm.renderControl(oControl._oAddButton);134 oRm.write("<div");135 oRm.writeAttribute("id", oControl.getId() + "-selectTag-panel");136 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederSelectTagPanel");137 oRm.addClass("sapUiShd");138 oRm.writeClasses();139 oRm.write(">");140 oRm.write("<div");141 oRm.writeAttribute("id", oControl.getId() + "-selectTag-arrow");142 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederSelectTagArrow");143 oRm.writeClasses();144 oRm.write(">");145 oRm.write("</div>");146 oRm.write("<div");147 oRm.writeAttribute("id", oControl.getId() + "-selectTag-header");148 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederSelectTagHeader");149 oRm.writeClasses();150 oRm.write(">");151 oRm.writeEscaped(oControl._rb.getText("NOTETAKERFEEDER_TOOLPOPUP_TITLE"));152 oRm.write("</div>");153 oRm.write("<div>");154 oRm.renderControl(oControl._oTagInput);155 oRm.write("</div>");156 oRm.write("<div>");157 oRm.renderControl(oControl._oTagList);158 oRm.write("</div>");159 oRm.write("<div");160 oRm.addClass("sapSuiteUiCommonsNoteTakerFeederSelectTagButtons");161 oRm.writeClasses();162 oRm.write(">");163 oRm.renderControl(oControl._oAddTagButton);164 oRm.renderControl(oControl._oCancelTagButton);165 oRm.write("</div>");166 oRm.write("</div>");167 oRm.write("</div>");...

Full Screen

Full Screen

TargetFilterRenderer-dbg.js

Source:TargetFilterRenderer-dbg.js Github

copy

Full Screen

1/*!2 * SAP UI development toolkit for HTML5 (SAPUI5) (c) Copyright 2009-2013 SAP AG. All rights reserved3 */4 5jQuery.sap.declare("sap.suite.ui.commons.TargetFilterRenderer");6/**7 * @class TargetFilter renderer. 8 * @static9 */10sap.suite.ui.commons.TargetFilterRenderer = {11};12/**13 * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.14 * 15 * @param {sap.ui.core.RenderManager} oRm the RenderManager that can be used for writing to the render output buffer16 * @param {sap.ui.core.Control} oControl an object representation of the control that should be rendered17 */18sap.suite.ui.commons.TargetFilterRenderer.render = function(oRm, oControl){ 19 oRm.write("<div");20 oRm.writeControlData(oControl);21 oRm.addClass("sapSuiteUiTF");22 oRm.writeClasses();23 oRm.write(">");24 oRm.write("<div");25 oRm.addClass("sapSuiteUiTFOuterCont");26 oRm.writeClasses();27 oRm.write(">");28 oRm.write("<div");29 oRm.addClass("sapSuiteUiTFOuterCircle");30 oRm.writeClasses();31 oRm.write(">");32 oRm.write("<div");33 oRm.addClass("sapSuiteUiTFVerticalLine");34 oRm.writeClasses();35 oRm.write(">");36 oRm.write("</div>");37// for (var iOthers = 0; iOthers < 4; iOthers++) {38// if (oControl.oLinkOthers[iOthers]) {39// oRm.write("<div>");40// // oRm.renderControl(oControl.oLinkOthers[iOthers]);41// oRm.write("</div>");42// }43// }44// var aLinkClouds = oControl._oModel.getLinkClouds();45// for (var i = 0; i < aLinkClouds.length; i++) {46// oRm.renderControl(aLinkClouds[i]);47// }48 for (var i = 0; i < oControl._aQudrants.length; i++) {49 oRm.renderControl(oControl._aQudrants[i]);50 }51 oRm.write("</div>");52// oRm.write("<div");53// oRm.addClass("sapSuiteUiTFParCont");54// oRm.addClass("Quad1");55// oRm.writeClasses();56// oRm.write(">");57// oRm.renderControl(oControl._oFilterCb0);58// oRm.write("</div>");59//60// oRm.write("<div");61// oRm.addClass("sapSuiteUiTFValHel");62// oRm.addClass("Quad1");63// oRm.writeClasses();64// oRm.write(">");65// oRm.renderControl(oControl._oValueHelpBtn1);66// oRm.write("</div>");67// 68// oRm.write("<div");69// oRm.addClass("sapSuiteUiTFParCont");70// oRm.addClass("Quad2");71// oRm.writeClasses();72// oRm.write(">");73// oRm.renderControl(oControl._oFilterCb1);74// oRm.write("</div>");75//76// oRm.write("<div");77// oRm.addClass("sapSuiteUiTFParCont");78// oRm.addClass("Quad3");79// oRm.writeClasses();80// oRm.write(">");81// oRm.renderControl(oControl._oFilterCb2);82// oRm.write("</div>");83//84// oRm.write("<div");85// oRm.addClass("sapSuiteUiTFParCont");86// oRm.addClass("Quad4");87// oRm.writeClasses();88// oRm.write(">");89// oRm.renderControl(oControl._oFilterCb3);90// oRm.write("</div>");91//92//93//94// oRm.write("<div");95// oRm.addClass("sapSuiteUiTFValHel");96// oRm.addClass("Quad2");97// oRm.writeClasses();98// oRm.write(">");99// oRm.renderControl(oControl._oValueHelpBtn2);100// oRm.write("</div>");101//102// oRm.write("<div");103// oRm.addClass("sapSuiteUiTFValHel");104// oRm.addClass("Quad3");105// oRm.writeClasses();106// oRm.write(">");107// oRm.renderControl(oControl._oValueHelpBtn3);108// oRm.write("</div>");109//110// oRm.write("<div");111// oRm.addClass("sapSuiteUiTFValHel");112// oRm.addClass("Quad4");113// oRm.writeClasses();114// oRm.write(">");115// oRm.renderControl(oControl._oValueHelpBtn4);116// oRm.write("</div>");117 oRm.write("<div");118 oRm.addClass("sapSuiteUiTFHorizontalLine");119 oRm.writeClasses();120 oRm.write(">");121 oRm.write("</div>");122 oRm.write("<div");123 oRm.addClass("sapSuiteUiTFCentralCircle");124 oRm.writeClasses();125 oRm.write(">");126 oRm.write("<div");127 oRm.addClass("sapSuiteUiTFCentralTopLabel");128 oRm.writeClasses();129 oRm.write(">");130 oRm.writeEscaped("Show Selected");131 oRm.write("</div>");132 133 oRm.renderControl(oControl._oCountDisplay);134 oRm.write("</div>");135/*136 oRm.write("<div");137 oRm.addClass("sapSuiteUiTFSettingsCont");138 oRm.writeClasses();139 oRm.write(">");140 oRm.renderControl(oControl._oSettingsBtn);141 oRm.write("</div>");142*/143 oRm.write("<div");144 oRm.addClass("sapSuiteUiTFRightPanel");145 oRm.writeClasses();146 oRm.write(">");147 oRm.renderControl(oControl._oRightPanel);148 oRm.write("</div>");149 oRm.write("</div>");150 oRm.write("<div");151 oRm.addClass("sapSuiteUiTFShutter");152 oRm.addClass("Top");153 oRm.writeClasses();154 oRm.write(">");155 oRm.write("</div>");156 157 oRm.write("<div");158 oRm.addClass("sapSuiteUiTFShutter");159 oRm.addClass("Bottom");160 oRm.writeClasses();161 oRm.write(">");162 oRm.write("</div>");163 oRm.write("</div>");...

Full Screen

Full Screen

read_maze_test.py

Source:read_maze_test.py Github

copy

Full Screen

...5import time6from src.config import RANDOM_SEED7# NUMPY_SEED = 12348# from src.lib.read_maze import maze_cells9def test_rm(maze_cells: np.ndarray,10 iterations: int = 100_000): # read maze11 rm_observations = []12 rm_positions = []13 for i in range(1, iterations):14 row, col = np.random.randint(1, 199, size=2)15 rm_positions.append(np.array([row, col]))16 new_maze_cells, observation = rm.get_local_maze_information(maze_cells, row, col)17 rm_observations.append(observation)18 return new_maze_cells, rm_positions, rm_observations19def test_frm(maze_cells: np.ndarray,20 iterations: int = 100_000): # read maze21 frm_observations = []22 frm_positions = []23 for i in range(1, iterations):24 row, col = np.random.randint(1, 199, size=2)25 frm_positions.append(np.array([row, col]))26 new_maze_cells, observation = frm.get_local_maze_information(maze_cells, row, col)27 frm_observations.append(observation)28 return new_maze_cells, frm_positions, frm_observations29if __name__ == '__main__':30 iterations = 10_00031 np.random.seed(RANDOM_SEED)32 random.seed(RANDOM_SEED)33 maze_cells = rm.load_maze('../mazes/final.npy')34 rm_t1 = time.process_time_ns()35 maze_cells, rm_positions, rm_observations = test_rm(maze_cells, iterations)36 rm_t2 = time.process_time_ns()37 rm_elapsed = rm_t2 - rm_t138 print('elapsed (RM):', rm_elapsed, 'ns')39 rm_maze_cells = maze_cells.copy()40 np.random.seed(RANDOM_SEED)41 random.seed(RANDOM_SEED)42 maze_cells = frm.load_maze('../mazes/final.npy')43 frm_t1 = time.process_time_ns()44 maze_cells, frm_positions, frm_observations = test_frm(maze_cells, iterations)45 frm_t2 = time.process_time_ns()46 frm_elapsed = frm_t2 - frm_t147 print('elapsed (fast RM):', frm_elapsed, 'ns')48 frm_maze_cells = maze_cells.copy()49 rm_positions = np.array(rm_positions)50 rm_observations = np.array(rm_observations)51 frm_positions = np.array(frm_positions)52 frm_observations = np.array(frm_observations)53 comparison = (rm_positions == frm_positions)54 are_equal = comparison.all()55 print('positions are equal: ', are_equal)56 comparison = (rm_observations == frm_observations)57 are_equal = comparison.all()58 print('observations are equal: ', are_equal)...

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 pytest-mock 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