当前位置: 首页>>代码示例>>Python>>正文


Python tools.assert_not_equal函数代码示例

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


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

示例1: test_posterior_transitions_w_training

def test_posterior_transitions_w_training():
	sequences = [ list(x) for x in ( 'A', 'ACT', 'GGCA', 'TACCTGT' ) ]
	indices = { state.name: i for i, state in enumerate( model.states ) }

	transitions = model.dense_transition_matrix()
	i0, i1, i2 = indices['I0'], indices['I1'], indices['I2']
	d1, d2, d3 = indices['D1'], indices['D2'], indices['D3']
	m1, m2, m3 = indices['M1'], indices['M2'], indices['M3']

	assert_equal( transitions[d1, i1], transitions[d2, i2] )
	assert_equal( transitions[i0, i0], transitions[i1, i1] )
	assert_equal( transitions[i0, i0], transitions[i2, i2] )
	assert_equal( transitions[i0, m1], transitions[i1, m2] )
	assert_equal( transitions[d1, d2], transitions[d2, d3] )
	assert_equal( transitions[i0, d1], transitions[i1, d2] )
	assert_equal( transitions[i0, d1], transitions[i2, d3] )

	model.train( sequences )
	transitions = model.dense_transition_matrix()

	assert_not_equal( transitions[d1, i1], transitions[d2, i2] )
	assert_not_equal( transitions[i0, m1], transitions[i1, m2] )
	assert_not_equal( transitions[d1, d2], transitions[d2, d3] )
	assert_not_equal( transitions[i0, d1], transitions[i1, d2] )
	assert_not_equal( transitions[i0, d1], transitions[i2, d3] )
开发者ID:Geoion,项目名称:pomegranate,代码行数:25,代码来源:test_profile_hmm.py

示例2: test_mx_lookup

def test_mx_lookup(ld, cmx):
    # has MX, has MX server
    ld.return_value = ['mx1.fake.mailgun.com', 'mx2.fake.mailgun.com']
    cmx.return_value = 'mx1.fake.mailgun.com'

    addr = address.validate_address('[email protected]')
    assert_not_equal(addr, None)

    # has fallback A, has MX server
    ld.return_value = ['domain.com']
    cmx.return_value = 'domain.com'

    addr = address.validate_address('[email protected]')
    assert_not_equal(addr, None)

    # has MX, no server answers
    ld.return_value = ['mx.example.com']
    cmx.return_value = None

    addr = address.validate_address('[email protected]')
    assert_equal(addr, None)

    # no MX
    ld.return_value = []
    cmx.return_value = None

    addr = address.validate_address('[email protected]')
    assert_equal(addr, None)
开发者ID:EthanBlackburn,项目名称:flanker,代码行数:28,代码来源:validator_test.py

示例3: test_customer_bank_accounts_create_new_idempotency_key_for_each_call

def test_customer_bank_accounts_create_new_idempotency_key_for_each_call():
    fixture = helpers.load_fixture('customer_bank_accounts')['create']
    helpers.stub_response(fixture)
    helpers.client.customer_bank_accounts.create(*fixture['url_params'])
    helpers.client.customer_bank_accounts.create(*fixture['url_params'])
    assert_not_equal(responses.calls[0].request.headers.get('Idempotency-Key'),
                     responses.calls[1].request.headers.get('Idempotency-Key'))
开发者ID:gocardless,项目名称:gocardless-pro-python,代码行数:7,代码来源:customer_bank_accounts_integration_test.py

示例4: test_fetch_adhd

def test_fetch_adhd():
    local_url = "file://" + tst.datadir

    sub1 = [3902469, 7774305, 3699991]
    sub2 = [2014113, 4275075, 1019436,
            3154996, 3884955, 27034,
            4134561, 27018, 6115230,
            27037, 8409791, 27011]
    sub3 = [3007585, 8697774, 9750701,
            10064, 21019, 10042,
            10128, 2497695, 4164316,
            1552181, 4046678, 23012]
    sub4 = [1679142, 1206380, 23008,
            4016887, 1418396, 2950754,
            3994098, 3520880, 1517058,
            9744150, 1562298, 3205761, 3624598]
    subs = np.array(sub1 + sub2 + sub3 + sub4, dtype='i8')
    subs = subs.view(dtype=[('Subject', 'i8')])
    tst.mock_fetch_files.add_csv(
        'ADHD200_40subs_motion_parameters_and_phenotypics.csv',
        subs)

    adhd = func.fetch_adhd(data_dir=tst.tmpdir, url=local_url,
                           n_subjects=12, verbose=0)
    assert_equal(len(adhd.func), 12)
    assert_equal(len(adhd.confounds), 12)
    assert_equal(len(tst.mock_url_request.urls), 13)  # Subjects + phenotypic
    assert_not_equal(adhd.description, '')
开发者ID:mrahim,项目名称:nilearn,代码行数:28,代码来源:test_func.py

示例5: test_get_collections

  def test_get_collections(self):
    resp = self.db.list_sentry_roles_by_group() # Non Sentry Admin can do that
    assert_not_equal(0, resp.status.value, resp)
    assert_true('denied' in resp.status.message, resp)

    resp = self.db.list_sentry_roles_by_group(groupName='*')
    assert_equal(0, resp.status.value, resp)
开发者ID:277800076,项目名称:hue,代码行数:7,代码来源:tests.py

示例6: test_001_is_runnable

    def test_001_is_runnable(self):
        """ Still running after we launch it.

        As authauth is a persistent server it should be still be running!"""
        time.sleep(1)
        assert_not_equal(self.process, None)
        assert_equal(self.process.poll(), None)
开发者ID:asimihsan,项目名称:listpile,代码行数:7,代码来源:test_model_basic.py

示例7: test_group

def test_group(module, EXAMPLE):
    assert_hasattr(module, 'Group')
    assert_is_instance(module.Group, type)

    shared = module.Shared.from_dict(EXAMPLE['shared'])
    values = EXAMPLE['values']
    for value in values:
        shared.add_value(value)

    group1 = module.Group()
    group1.init(shared)
    for value in values:
        group1.add_value(shared, value)
    group2 = module.Group.from_values(shared, values)
    assert_close(group1.dump(), group2.dump())

    group = module.Group.from_values(shared, values)
    dumped = group.dump()
    group.init(shared)
    group.load(dumped)
    assert_close(group.dump(), dumped)

    for value in values:
        group2.remove_value(shared, value)
    assert_not_equal(group1, group2)
    group2.merge(shared, group1)

    for value in values:
        group1.score_value(shared, value)
    for _ in xrange(10):
        value = group1.sample_value(shared)
        group1.score_value(shared, value)
        module.sample_group(shared, 10)
    group1.score_data(shared)
    group2.score_data(shared)
开发者ID:dlovell,项目名称:distributions,代码行数:35,代码来源:test_models.py

示例8: test_info

def test_info():
    "Check that Inspector.info fills out various fields as expected."
    i = inspector.info(Call, oname='Call')
    nt.assert_equal(i['type_name'], 'type')
    expted_class = str(type(type))  # <class 'type'> (Python 3) or <type 'type'>
    nt.assert_equal(i['base_class'], expted_class)
    nt.assert_regex(i['string_form'], "<class 'IPython.core.tests.test_oinspect.Call'( at 0x[0-9a-f]{1,9})?>")
    fname = __file__
    if fname.endswith(".pyc"):
        fname = fname[:-1]
    # case-insensitive comparison needed on some filesystems
    # e.g. Windows:
    nt.assert_equal(i['file'].lower(), compress_user(fname).lower())
    nt.assert_equal(i['definition'], None)
    nt.assert_equal(i['docstring'], Call.__doc__)
    nt.assert_equal(i['source'], None)
    nt.assert_true(i['isclass'])
    nt.assert_equal(i['init_definition'], "Call(x, y=1)")
    nt.assert_equal(i['init_docstring'], Call.__init__.__doc__)

    i = inspector.info(Call, detail_level=1)
    nt.assert_not_equal(i['source'], None)
    nt.assert_equal(i['docstring'], None)

    c = Call(1)
    c.__doc__ = "Modified instance docstring"
    i = inspector.info(c)
    nt.assert_equal(i['type_name'], 'Call')
    nt.assert_equal(i['docstring'], "Modified instance docstring")
    nt.assert_equal(i['class_docstring'], Call.__doc__)
    nt.assert_equal(i['init_docstring'], Call.__init__.__doc__)
    nt.assert_equal(i['call_docstring'], Call.__call__.__doc__)
开发者ID:PKpacheco,项目名称:monitor-dollar-value-galicia,代码行数:32,代码来源:test_oinspect.py

示例9: test_rev

    def test_rev(self):
        doc = self.create_document({})

        doc._rev = None

        assert_not_equal(doc._id, None)
        assert_equal(doc._rev, None)
开发者ID:aniljava,项目名称:arango-python,代码行数:7,代码来源:tests_document.py

示例10: test_outgoing_url

def test_outgoing_url():
    redirect_url = settings.REDIRECT_URL
    secretkey = settings.REDIRECT_SECRET_KEY
    exceptions = settings.REDIRECT_URL_WHITELIST
    settings.REDIRECT_URL = 'http://example.net'
    settings.REDIRECT_SECRET_KEY = 'sekrit'
    settings.REDIRECT_URL_WHITELIST = ['nicedomain.com']

    try:
        myurl = 'http://example.com'
        s = urlresolvers.get_outgoing_url(myurl)

        # Regular URLs must be escaped.
        eq_(s,
            'http://example.net/bc7d4bb262c9f0b0f6d3412ede7d3252c2e311bb1d55f6'
            '2315f636cb8a70913b/'
            'http%3A//example.com')

        # No double-escaping of outgoing URLs.
        s2 = urlresolvers.get_outgoing_url(s)
        eq_(s, s2)

        evil = settings.REDIRECT_URL.rstrip('/') + '.evildomain.com'
        s = urlresolvers.get_outgoing_url(evil)
        assert_not_equal(s, evil,
                         'No subdomain abuse of double-escaping protection.')

        nice = 'http://nicedomain.com/lets/go/go/go'
        eq_(nice, urlresolvers.get_outgoing_url(nice))

    finally:
        settings.REDIRECT_URL = redirect_url
        settings.REDIRECT_SECRET_KEY = secretkey
        settings.REDIRECT_URL_WHITELIST = exceptions
开发者ID:abdellah-bn,项目名称:olympia,代码行数:34,代码来源:test_url_prefix.py

示例11: test_allocate

    def test_allocate(self):
        self.block.from_list([0] * 100)
        assert_raises(InvalidArgumentError, self.block.allocate)
        assert_raises(InvalidArgumentError, self.block.allocate, None, 0)
        assert_raises(InvalidArgumentError, self.block.allocate, None, -1)
        assert_raises(InvalidArgumentError, self.block.allocate, None, -10)
        assert_raises(InvalidArgumentError, self.block.allocate, [], None)
        assert_raises(InvalidArgumentError, self.block.allocate, [1], 2)

        # Allocate an entire range
        self.block.deallocate((0, 49))
        assert_raises(NotEnoughUnallocatedSpaceError, self.block.allocate, None, 51)
        offset = self.block.allocate(size=50)
        assert_equal(offset, 0)
        assert_equal(self.block.unallocated_ranges, [])

        # Allocate the beginning of a range
        self.block.deallocate((10, 39))
        offset = self.block.allocate(data=[0x12, 0x34, 0xef])
        assert_equal(offset, 10)
        assert_equal(self.block.unallocated_ranges, [(13, 39)])
        assert_equal(self.block[offset:offset + 3].to_list(), [0x12, 0x34, 0xef])
        assert_not_equal(self.block.to_list(), [0] * 100)
        self.block[offset:offset + 3] = [0] * 3
        assert_equal(self.block.to_list(), [0] * 100)
开发者ID:LittleCube13,项目名称:CoilSnake,代码行数:25,代码来源:test_blocks.py

示例12: test_write_uncor

 def test_write_uncor(self):
     """ Testcase main """
     assert_equal(self.nvme_read(), 0)
     assert_equal(self.write_uncor(), 0)
     assert_not_equal(self.nvme_read(), 0)
     assert_equal(self.nvme_write(), 0)
     assert_equal(self.nvme_read(), 0)
开发者ID:YuanDdQiao,项目名称:nvme-cli,代码行数:7,代码来源:nvme_writeuncor_test.py

示例13: test_farsi_correction

def test_farsi_correction():
    """Verify that a Farsi sentence is corrected"""
    wrong = u"ابن یک جملهٔ آرمایسی است"
    right = u"این یک جملهٔ آزمایشی است"
    corrected = d.suggest(wrong)
    new = u" ".join([word.new for word in corrected])
    assert_not_equal(wrong, new)
开发者ID:pcraciunoiu,项目名称:didyoumean,代码行数:7,代码来源:test_basic_farsi.py

示例14: test_select

 def test_select(self):
     for db in settings.DATABASES:
         people = Employee.objects.db_manager(db).select()
         assert_not_equal(people.count(), 0)
         for p in people:
             ok_(p.first_name)
             ok_(p.last_name)
开发者ID:uranusjr,项目名称:django-mosql,代码行数:7,代码来源:tests.py

示例15: test2

def test2():
    datafile = resource_filename('sknano', 'data/nanotubes/1010_1cell.data')
    atoms = DATAData(fpath=datafile).atoms
    atoms.assign_unique_ids()
    atoms.update_attrs()
    assert_not_equal(atoms.Natoms, 20)
    assert_equal(atoms.Natoms, 40)
开发者ID:chr7stos,项目名称:scikit-nano,代码行数:7,代码来源:test_lammps_data_format.py


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