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
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
三大验证模块概述 在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
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
问题场景:修改查询数据时,页面有提示信息,但是定位到提示信息的位置后,通过ele.text或者其他方法都无法获取具体的提示内容;最后通过get_attribute('innerHTML')搞定。 示例:ele = self.driver.find_element_by_xpath("//div[2] ...
分类:
编程语言 时间:
2020-07-22 20:17:32
阅读次数:
83
原文来自知乎,现摘录与此 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
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
本章节主要介绍pg创建的流程,主要包括两部分,第一部分是创建pg在mon上跳转的流程。第二部分是osd端的pg创建流程。
分类:
其他好文 时间:
2020-07-22 02:20:49
阅读次数:
151