码迷,mamicode.com
首页 >  
搜索关键字:self    ( 14215个结果
RobotFramework框架执行UI自动化用例,都调用一个公共测试库,怎么只打开一个浏览器
WebOpLib.py测试库 from selenium import webdriver from cfg import *class WebOpLib(): def openwebsite(self): self.driver=webdriver.Chrome() self.driver.max ...
分类:其他好文   时间:2020-07-23 18:56:59    阅读次数:112
pytest 生成测试报告
pip安装 pip install pytest-html 编写脚本 import pytest class TestClass(object): def test_one(self): x = "this" assert 'h' in x def test_two(self): x = "hell ...
分类:其他好文   时间:2020-07-23 16:50:29    阅读次数:121
重建二叉树—递归
二叉树重建 问题:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重 复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。 解决: #递归一 # class Tree ...
分类:其他好文   时间:2020-07-23 16:17:32    阅读次数:71
django-rest-framework-源码解析004-三大验证(认证/权限/限流)
三大验证模块概述 在DRF的APIView重写的dispatch方法中, self.initial(request, *args, **kwargs) 这句话就是执行三大验证的逻辑, 点进去可以看到依次执行的就是认证(authentication)/权限(permission)/限流(throttl ...
分类:其他好文   时间:2020-07-23 16:05:48    阅读次数:66
逆序打印链表
问题:输入一个链表,按链表从尾到头的顺序返回一个ArrayList。 解决: #方法一: class Solution: def printListFromTailToHead(self, listNode): # write code here ArrayList = [] while listN ...
分类:其他好文   时间:2020-07-23 01:36:18    阅读次数:62
Django手写分页
def get(self, request, *args, **kwargs): # 获取当前页码 pg = int(request.GET.get('page', 1)) obj = Student.objects.all().order_by("id") # 创建分页器对象 page_obj = ...
分类:其他好文   时间:2020-07-22 20:58:35    阅读次数:93
解决python+selenium无法获取提示内容
问题场景:修改查询数据时,页面有提示信息,但是定位到提示信息的位置后,通过ele.text或者其他方法都无法获取具体的提示内容;最后通过get_attribute('innerHTML')搞定。 示例:ele = self.driver.find_element_by_xpath("//div[2] ...
分类:编程语言   时间:2020-07-22 20:17:32    阅读次数:83
pytorch(三) PyTorch 1.1.0 源码解析--运行机制
原文来自知乎,现摘录与此 https://zhuanlan.zhihu.com/p/67964081 首先这是一段mnist数据集的基本代码。 class Net(nn.Module): def __init__(self): super(Net, self).__init__() self.con ...
分类:其他好文   时间:2020-07-22 16:23:29    阅读次数:105
238. Product of Array Except Self
Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except n ...
分类:其他好文   时间:2020-07-22 15:50:36    阅读次数:67
Ceph PG创建流程源码分析
本章节主要介绍pg创建的流程,主要包括两部分,第一部分是创建pg在mon上跳转的流程。第二部分是osd端的pg创建流程。
分类:其他好文   时间:2020-07-22 02:20:49    阅读次数:151
14215条   上一页 1 ... 33 34 35 36 37 ... 1422 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!