python类assert_is_not_none()的实例源码

test_display.py 文件源码 项目:leetcode 作者: thomasyimgit 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def test_image_filename_defaults():
    '''test format constraint, and validity of jpeg and png'''
    tpath = ipath.get_ipython_package_dir()
    nt.assert_raises(ValueError, display.Image, filename=os.path.join(tpath, 'testing/tests/badformat.gif'),
                     embed=True)
    nt.assert_raises(ValueError, display.Image)
    nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True)
    # check boths paths to allow packages to test at build and install time
    imgfile = os.path.join(tpath, 'core/tests/2x2.png')
    img = display.Image(filename=imgfile)
    nt.assert_equal('png', img.format)
    nt.assert_is_not_none(img._repr_png_())
    img = display.Image(filename=os.path.join(tpath, 'testing/tests/logo.jpg'), embed=False)
    nt.assert_equal('jpeg', img.format)
    nt.assert_is_none(img._repr_jpeg_())
test_oinspect.py 文件源码 项目:leetcode 作者: thomasyimgit 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def test_builtin_init():
    info = inspector.info(list)
    init_def = info['init_definition']
    # Python < 3.4 can't get init definition from builtins,
    # but still exercise the inspection in case of error-raising bugs.
    if sys.version_info >= (3,4):
        nt.assert_is_not_none(init_def)
test_display.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def test_image_filename_defaults():
    '''test format constraint, and validity of jpeg and png'''
    tpath = ipath.get_ipython_package_dir()
    nt.assert_raises(ValueError, display.Image, filename=os.path.join(tpath, 'testing/tests/badformat.gif'),
                     embed=True)
    nt.assert_raises(ValueError, display.Image)
    nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True)
    # check boths paths to allow packages to test at build and install time
    imgfile = os.path.join(tpath, 'core/tests/2x2.png')
    img = display.Image(filename=imgfile)
    nt.assert_equal('png', img.format)
    nt.assert_is_not_none(img._repr_png_())
    img = display.Image(filename=os.path.join(tpath, 'testing/tests/logo.jpg'), embed=False)
    nt.assert_equal('jpeg', img.format)
    nt.assert_is_none(img._repr_jpeg_())
test_oinspect.py 文件源码 项目:Repobot 作者: Desgard 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def test_builtin_init():
    info = inspector.info(list)
    init_def = info['init_definition']
    # Python < 3.4 can't get init definition from builtins,
    # but still exercise the inspection in case of error-raising bugs.
    if sys.version_info >= (3,4):
        nt.assert_is_not_none(init_def)
api_tests.py 文件源码 项目:birdseye-server 作者: DramaticLiberty 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def assert_error(code, response):
    nt.assert_equal(response.status_code, code)
    nt.assert_equal(response.content_type, 'application/json')
    jr = json.loads(response.get_data(as_text=True))
    nt.assert_equal(jr['status'], 'error')
    nt.assert_is_not_none(jr['message'])
    return jr
api_tests.py 文件源码 项目:birdseye-server 作者: DramaticLiberty 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def test_get_root(self):
        resp = assert_ok(200, self.client.get('/v1'))
        nt.assert_is_not_none(resp['version'])
jobs_tests.py 文件源码 项目:birdseye-server 作者: DramaticLiberty 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def test_file_path_url(self):
        img_args_fp, _ = jobs.gcv_params(self.file_path)
        nt.assert_is_not_none(img_args_fp)

        img_args_url, _ = jobs.gcv_params(self.file_url)
        nt.assert_is_not_none(img_args_url)
        nt.assert_true(img_args_fp.keys() != img_args_url.keys)
jobs_tests.py 文件源码 项目:birdseye-server 作者: DramaticLiberty 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def test_convert_poly(self):
        gps = jobs.detect_exif_gps(self.file_path_gps)
        gps_poly = jobs.make_poly(gps[0], gps[1], 0.00001)
        nt.assert_is_not_none(gps_poly)
        nt.assert_true(gps_poly.startswith('POLYGON('))
test_display.py 文件源码 项目:blender 作者: gastrodia 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def test_image_filename_defaults():
    '''test format constraint, and validity of jpeg and png'''
    tpath = ipath.get_ipython_package_dir()
    nt.assert_raises(ValueError, display.Image, filename=os.path.join(tpath, 'testing/tests/badformat.gif'),
                     embed=True)
    nt.assert_raises(ValueError, display.Image)
    nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True)
    # check boths paths to allow packages to test at build and install time
    imgfile = os.path.join(tpath, 'core/tests/2x2.png')
    img = display.Image(filename=imgfile)
    nt.assert_equal('png', img.format)
    nt.assert_is_not_none(img._repr_png_())
    img = display.Image(filename=os.path.join(tpath, 'testing/tests/logo.jpg'), embed=False)
    nt.assert_equal('jpeg', img.format)
    nt.assert_is_none(img._repr_jpeg_())
test_oinspect.py 文件源码 项目:blender 作者: gastrodia 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def test_builtin_init():
    info = inspector.info(list)
    init_def = info['init_definition']
    # Python < 3.4 can't get init definition from builtins,
    # but still exercise the inspection in case of error-raising bugs.
    if sys.version_info >= (3,4):
        nt.assert_is_not_none(init_def)
test_display.py 文件源码 项目:yatta_reader 作者: sound88 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def test_image_filename_defaults():
    '''test format constraint, and validity of jpeg and png'''
    tpath = ipath.get_ipython_package_dir()
    nt.assert_raises(ValueError, display.Image, filename=os.path.join(tpath, 'testing/tests/badformat.zip'),
                     embed=True)
    nt.assert_raises(ValueError, display.Image)
    nt.assert_raises(ValueError, display.Image, data='this is not an image', format='badformat', embed=True)
    # check boths paths to allow packages to test at build and install time
    imgfile = os.path.join(tpath, 'core/tests/2x2.png')
    img = display.Image(filename=imgfile)
    nt.assert_equal('png', img.format)
    nt.assert_is_not_none(img._repr_png_())
    img = display.Image(filename=os.path.join(tpath, 'testing/tests/logo.jpg'), embed=False)
    nt.assert_equal('jpeg', img.format)
    nt.assert_is_none(img._repr_jpeg_())
test_oinspect.py 文件源码 项目:yatta_reader 作者: sound88 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def test_builtin_init():
    info = inspector.info(list)
    init_def = info['init_definition']
    # Python < 3.4 can't get init definition from builtins,
    # but still exercise the inspection in case of error-raising bugs.
    if sys.version_info >= (3,4):
        nt.assert_is_not_none(init_def)


问题


面经


文章

微信
公众号

扫码关注公众号