• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tools.assert_is_not函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中nose.tools.assert_is_not函数的典型用法代码示例。如果您正苦于以下问题:Python assert_is_not函数的具体用法?Python assert_is_not怎么用?Python assert_is_not使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了assert_is_not函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: runTest

            def runTest(self):
                log.debug('sys.stdout is the initial value: {}'.format(
                    sys.stdout is _cached_stdout))
                assert_is_not(sys.stdout, _cached_stdout)  # sys.stdout should be replaced

                log.debug('sleeping {} seconds'.format(wait))
                time.sleep(wait)
开发者ID:mambocab,项目名称:nose_call_on_hang,代码行数:7,代码来源:test.py


示例2: test_pickle_func

def test_pickle_func():
    def f(x):
        return x + 23
    assert_equal(f(1), 24)
    f2 = unpickle(pickle(f))
    assert_is_not(f, f2)
    assert_equal(f(2), 25)
开发者ID:albertz,项目名称:extpickle,代码行数:7,代码来源:test_extpickle.py


示例3: test_copy_msg

 def test_copy_msg(self):
     
     x = NetParameter()
     assert_is_not_none(x)
     y = pu.copy_msg(x, NetParameter)
     assert_is_not(x, y)
     assert_is_not_none(y)
开发者ID:caochensi,项目名称:nideep,代码行数:7,代码来源:test_proto_utils.py


示例4: test_getslice_lazy

 def test_getslice_lazy(self):
     seq = self.get_sequence([1, 2, 3])
     sliced = seq[:2]
     tools.assert_is_not(sliced, seq)
     tools.assert_items_equal(sliced, [1, 2])
     tools.assert_true(seq.iterable)
     tools.eq_(list(seq._results.__iter__()), [1, 2])
开发者ID:edgeflip,项目名称:faraday,代码行数:7,代码来源:test_structs.py


示例5: test_no_data_leak

def test_no_data_leak():
    cols_before = diamonds.columns.copy()
    import numpy as np
    p = ggplot(aes(x="np.log(price)"), data=diamonds)
    cols_after = diamonds.columns.copy()
    assert_same_elements(cols_before, cols_after)
    assert_is_not(diamonds, p.data)
开发者ID:2dpodcast,项目名称:ggplot,代码行数:7,代码来源:test_ggplot_internals.py


示例6: test_remap

def test_remap():
    src = np.array([1, 2, 3, 4])
    mapping = np.array([-1, 10, 20, 30, 40])

    rtn = remap(src, mapping)
    assert_array_equal(rtn, [10, 20, 30, 40])
    assert_is_not(rtn, src)
开发者ID:laijingtao,项目名称:landlab,代码行数:7,代码来源:test_remap.py


示例7: test_enqueue_measure1

    def test_enqueue_measure1(self):
        # Test enqueueing a measure passing the tests using no instruments.

        core = self.workbench.get_plugin(u'enaml.workbench.core')
        cmd = u'enaml.workbench.ui.select_workspace'
        core.invoke_command(cmd, {'workspace': u'hqc_meas.measure.workspace'},
                            self)

        plugin = self.workbench.get_plugin(u'hqc_meas.measure')

        measure = Measure(plugin=plugin, name='Test')
        measure.root_task = RootTask(default_path=self.test_dir)
        plugin.edited_measure = measure

        res = plugin.workspace.enqueue_measure(plugin.edited_measure)

        assert_true(res)
        assert_false(measure.root_task.run_time)
        assert_true(plugin.enqueued_measures)
        en_meas = plugin.enqueued_measures[0]
        assert_is_not(en_meas, measure)
        assert_equal(en_meas.status, 'READY')
        assert_equal(en_meas.infos,
                     'The measure is ready to be performed by an engine.')
        assert_in('build_deps', en_meas.store)
        assert_not_in('profiles', en_meas.store)
开发者ID:MatthieuDartiailh,项目名称:HQCMeas,代码行数:26,代码来源:test_workspace.py


示例8: test_enqueue_measure4

    def test_enqueue_measure4(self):
        # Test enqueueing a measure passing the tests using instruments.

        core = self.workbench.get_plugin(u'enaml.workbench.core')
        cmd = u'enaml.workbench.ui.select_workspace'
        core.invoke_command(cmd, {'workspace': u'hqc_meas.measure.workspace'},
                            self)

        plugin = self.workbench.get_plugin(u'hqc_meas.measure')

        false_instr_user = FalseInstrTask(selected_profile='  dummy  ',
                                          selected_driver='PanelTestDummy')
        measure = Measure(plugin=plugin, name='Test')
        measure.root_task = RootTask(default_path=self.test_dir)
        measure.root_task.children_task = [false_instr_user]
        plugin.edited_measure = measure

        res = plugin.workspace.enqueue_measure(plugin.edited_measure)

        assert_true(res)
        assert_false(measure.root_task.run_time)
        assert_true(plugin.enqueued_measures)
        en_meas = plugin.enqueued_measures[0]
        assert_is_not(en_meas, measure)
        assert_equal(en_meas.status, 'READY')
        assert_equal(en_meas.infos,
                     'The measure is ready to be performed by an engine.')
        assert_in('build_deps', en_meas.store)
        assert_equal(['  dummy  '], en_meas.store['profiles'])
        assert_in('drivers', en_meas.root_task.run_time)

        instr_plugin = self.workbench.get_plugin('hqc_meas.instr_manager')
        assert_in('  dummy  ', instr_plugin.available_profiles)
开发者ID:MatthieuDartiailh,项目名称:HQCMeas,代码行数:33,代码来源:test_workspace.py


示例9: test_driver_reload

    def test_driver_reload(self):
        # Test reloading a driver.
        self.workbench.register(InstrManagerManifest())
        self.workbench.register(InstrUser1())
        core = self.workbench.get_plugin(u'enaml.workbench.core')

        com = u'hqc_meas.instr_manager.driver_types_request'
        d_types, _ = core.invoke_command(com, {'driver_types': ['Dummy']},
                                         self)

        com = u'hqc_meas.instr_manager.drivers_request'
        drivers, _ = core.invoke_command(com, {'drivers': ['PanelTestDummy']},
                                         self)

        com = u'hqc_meas.instr_manager.reload_driver'
        re_driver = core.invoke_command(com, {'driver': 'PanelTestDummy'},
                                        self)

        assert_is_not(re_driver, drivers['PanelTestDummy'])
        assert_equal(re_driver.__name__, 'PanelTestDummy')

        com = u'hqc_meas.instr_manager.driver_types_request'
        re_d_types, _ = core.invoke_command(com, {'driver_types': ['Dummy']},
                                            self)

        assert_is_not(re_d_types['Dummy'], d_types['Dummy'])
        assert_equal(re_d_types['Dummy'].__name__, 'DummyInstrument')
开发者ID:MatthieuDartiailh,项目名称:HQCMeas,代码行数:27,代码来源:test_plugin.py


示例10: test_execute

    def test_execute(self):
        cm = ComputationManager()

        df = pd.DataFrame(np.random.randn(30, 3), columns=['a', 'bob', 'c'])
        source = "df.rolling(5).sum()"
        entry = cm_get(cm, source, locals(), globals())

        # execute first time
        val = cm.execute(entry)
        correct = df.rolling(5).sum()

        nt.assert_is_not(val, correct)
        tm.assert_frame_equal(val, correct)

        # execute again should return existing value
        val2 = cm.execute(entry)
        nt.assert_is(val, val2)

        entry2 = cm_get(cm, source, locals(), globals())
        nt.assert_is(entry, entry2)
        nt.assert_true(entry2.executed)

        # override keyword
        val3 = cm.execute(entry, override=True)
        nt.assert_is_not(val, val3)
        tm.assert_frame_equal(val, val3)
        cm = ComputationManager()
开发者ID:dalejung,项目名称:naginpy,代码行数:27,代码来源:test_computation.py


示例11: test_restricted_induced_subgraph_chains

    def test_restricted_induced_subgraph_chains(self):
        """ Test subgraph chains that both restrict and show nodes/edges.

        A restricted_view subgraph should allow induced subgraphs using
        G.subgraph that automagically without a chain (meaning the result
        is a subgraph view of the original graph not a subgraph-of-subgraph.
        """
        hide_nodes = [3, 4, 5]
        hide_edges = [(6, 7)]
        RG = nx.restricted_view(self.G, hide_nodes, hide_edges)
        nodes = [4, 5, 6, 7, 8]
        SG = nx.induced_subgraph(RG, nodes)
        SSG = RG.subgraph(nodes)
        assert_is(SSG.root_graph, SSG._graph)
        assert_is_not(SG.root_graph, SG._graph)
        assert_edges_equal(SG.edges, SSG.edges)
        # should be same as morphing the graph
        CG = self.G.copy()
        CG.remove_nodes_from(hide_nodes)
        CG.remove_edges_from(hide_edges)
        assert_edges_equal(CG.edges(nodes), SSG.edges)
        CG.remove_nodes_from([0, 1, 2, 3])
        assert_edges_equal(CG.edges, SSG.edges)
        # switch order: subgraph first, then restricted view
        SSSG = self.G.subgraph(nodes)
        RSG = nx.restricted_view(SSSG, hide_nodes, hide_edges)
        assert_is_not(RSG.root_graph, RSG._graph)
        assert_edges_equal(RSG.edges, CG.edges)
开发者ID:ProgVal,项目名称:networkx,代码行数:28,代码来源:test_graphviews.py


示例12: test_getitem

 def test_getitem(self):
     assert_is_not(self.adjview[1], self.s[1])
     assert_is(self.adjview[0][7], self.adjview[0][3])
     assert_equal(self.adjview[2]['key']['color'], 1)
     assert_equal(self.adjview[2][1]['span'], 2)
     assert_raises(KeyError, self.adjview.__getitem__, 4)
     assert_raises(KeyError, self.adjview[1].__getitem__, 'key')
开发者ID:ProgVal,项目名称:networkx,代码行数:7,代码来源:test_coreviews.py


示例13: test_retrieval

 def test_retrieval(self):
     user = self.User.items.create(uid=123)
     token = self.Token(uid=123, token='abc')
     tools.assert_not_in('_user_cache', vars(token))
     tools.eq_(dict(token), {'uid': 123, 'token': 'abc'})
     tools.eq_(token.user, user)
     tools.assert_is_not(token.user, user)
     tools.assert_in('_user_cache', vars(token))
开发者ID:edgeflip,项目名称:faraday,代码行数:8,代码来源:test_items.py


示例14: test_flip_copy

def test_flip_copy():
    x = np.arange(12.0)
    y = sgrid.reshape_array((3, 4), x, flip_vertically=True, copy=True)

    assert_equal(y.shape, (3, 4))
    assert_array_equal(y, np.array([[8.0, 9.0, 10.0, 11.0], [4.0, 5.0, 6.0, 7.0], [0.0, 1.0, 2.0, 3.0]]))
    assert_true(y.flags["C_CONTIGUOUS"])
    assert_is_not(y.base, x)
开发者ID:gregtucker,项目名称:landlab,代码行数:8,代码来源:test_structured_grid.py


示例15: test_set_preserves_identity

    def test_set_preserves_identity(self):
        first_get = self.get()
        assert_is_not(self.new_value, first_get)
        self.set(self.new_value)
        second_get = self.get()

        assert_is(self.new_value, second_get)
        assert_is_not(first_get, second_get)
开发者ID:qvin,项目名称:XBlock,代码行数:8,代码来源:test_fields_api.py


示例16: test_duplicate_creation

 def test_duplicate_creation(self):
     db = create(db="test").database.create()
     db2 = create(db="test").database.create()
     assert_is_not(db, None)
     assert_is_not(db2, None)
     # assert_equal(db, db2)
     db.delete()
     db2.delete()
开发者ID:hiroaki-yamamoto,项目名称:arango-python,代码行数:8,代码来源:tests_db_integration.py


示例17: test_deep_const

    def test_deep_const(self):
        l = [1, 2, 3]
        assert_is_not(SD(l)(), l)
        (SD(l).append(_))(4)
        not_formula_and_eq(l, [1, 2, 3])

        (SC(l).append(_))(4)
        not_formula_and_eq(l, [1, 2, 3, 4])
开发者ID:higumachan,项目名称:pyscalambda,代码行数:8,代码来源:test_underscore.py


示例18: test_set_with_save_preserves_identity

    def test_set_with_save_preserves_identity(self):
        first_get = self.get()
        self.set(self.new_value)
        self.block.save()
        second_get = self.get()

        assert_is(self.new_value, second_get)
        assert_is_not(first_get, second_get)
开发者ID:qvin,项目名称:XBlock,代码行数:8,代码来源:test_fields_api.py


示例19: test_get_value_copy

def test_get_value_copy():
    model = BmiHeat()
    model.initialize()

    z0 = model.get_value('plate_surface__temperature')
    z1 = model.get_value('plate_surface__temperature')

    assert_is_not(z0, z1)
    assert_array_almost_equal(z0, z1)
开发者ID:katmratliff,项目名称:bmi-python,代码行数:9,代码来源:test_get_value.py


示例20: class_definitions_assignments_shadow_variables_of_same_name_in_outer_scope

def class_definitions_assignments_shadow_variables_of_same_name_in_outer_scope():
    ref = nodes.ref("x")
    body = [nodes.assign([ref], nodes.none())]
    node = nodes.class_("User", body)
    
    declarations = _create_declarations(["x", "User"])
    
    references = resolve(node, declarations)
    assert_is_not(declarations.declaration("x"), references.referenced_declaration(ref))
开发者ID:mwilliamson,项目名称:nope,代码行数:9,代码来源:name_resolution_tests.py



注:本文中的nose.tools.assert_is_not函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tools.assert_is_not_none函数代码示例发布时间:2022-05-27
下一篇:
Python tools.assert_is_none函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap