本文整理汇总了Python中nose.tools.eq_函数的典型用法代码示例。如果您正苦于以下问题:Python eq_函数的具体用法?Python eq_怎么用?Python eq_使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了eq_函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_file_owner
def test_file_owner(self):
new_owner = 'newowner'
self.client.write('foo', 'hello, world!')
self.client.set_owner('foo', 'oldowner')
self.client.set_owner('foo', new_owner)
status = self.client.status('foo')
eq_(status['owner'], new_owner)
开发者ID:e-heller,项目名称:hdfs,代码行数:7,代码来源:test_client.py
示例2: test_with_oddly_formatted_composer_file
def test_with_oddly_formatted_composer_file(self):
exts = self.extension_module.ComposerConfiguration({
'BUILD_DIR': ''
}).read_exts_from_path(
'tests/data/composer/composer-format.json')
eq_(1, len(exts))
eq_('mysqli', exts[0])
开发者ID:nsharma283,项目名称:PCF-php-buildpack,代码行数:7,代码来源:test_composer.py
示例3: test_valid_disabled_snippet_authenticated
def test_valid_disabled_snippet_authenticated(self):
"""Test disabled snippet returns 200 to authenticated users."""
snippet = SnippetFactory.create(disabled=True)
User.objects.create_superuser('admin', '[email protected]', 'asdf')
self.client.login(username='admin', password='asdf')
response = self.client.get(reverse('base.show', kwargs={'snippet_id': snippet.id}))
eq_(response.status_code, 200)
开发者ID:alicoding,项目名称:snippets-service,代码行数:7,代码来源:test_views.py
示例4: test_sample_info_genotype
def test_sample_info_genotype():
variants = load_vcf(data_path("multiallelic.vcf"))
assert len(variants) == 2, "Expected 2 variants but got %s" % variants
eq_(variants.metadata[variants[0]]['sample_info']['metastasis']['GT'],
'0/1')
eq_(variants.metadata[variants[1]]['sample_info']['metastasis']['GT'],
'0/1')
开发者ID:hammerlab,项目名称:varcode,代码行数:7,代码来源:test_vcf.py
示例5: __test
def __test(hop_length, fmin, n_bins, bins_per_octave,
tuning, resolution, norm, sparsity):
C2 = librosa.hybrid_cqt(y, sr=sr,
hop_length=hop_length,
fmin=fmin, n_bins=n_bins,
bins_per_octave=bins_per_octave,
tuning=tuning, resolution=resolution,
norm=norm,
sparsity=sparsity)
C1 = librosa.cqt(y, sr=sr,
hop_length=hop_length,
fmin=fmin, n_bins=n_bins,
bins_per_octave=bins_per_octave,
tuning=tuning, resolution=resolution,
norm=norm,
sparsity=sparsity)
eq_(C1.shape, C2.shape)
# Check for numerical comparability
idx1 = (C1 > 1e-4 * C1.max())
idx2 = (C2 > 1e-4 * C2.max())
perc = 0.99
thresh = 1e-3
idx = idx1 | idx2
assert np.percentile(np.abs(C1[idx] - C2[idx]),
perc) < thresh * max(C1.max(), C2.max())
开发者ID:keunwoochoi,项目名称:librosa,代码行数:33,代码来源:test_constantq.py
示例6: test_channel_edit_child
def test_channel_edit_child(self):
channel = Channel.objects.get(slug='testing')
response = self.client.get(
reverse('manage:channel_edit', args=(channel.pk,)),
)
eq_(response.status_code, 200)
choices = (
response.content
.split('name="parent"')[1]
.split('</select>')[0]
)
ok_('Main' in choices)
# you should not be able to self-reference
ok_('Testing' not in choices)
main = Channel.objects.get(slug='main')
response = self.client.post(
reverse('manage:channel_edit', args=(channel.pk,)),
{
'name': 'Different',
'slug': 'different',
'description': '<p>Other things</p>',
'parent': main.pk,
'feed_size': 10,
}
)
eq_(response.status_code, 302)
channel = Channel.objects.get(slug='different')
eq_(channel.parent, main)
# now expect two links to "Main" on the channels page
response = self.client.get(reverse('manage:channels'))
eq_(response.status_code, 200)
view_url = reverse('main:home_channels', args=(main.slug,))
eq_(response.content.count(view_url), 2)
开发者ID:jlin,项目名称:airmozilla,代码行数:35,代码来源:test_channels.py
示例7: test_file_size
def test_file_size(self):
self.viewer.extract()
self.viewer.get_files()
self.viewer.select('install.js')
res = self.viewer.read_file()
eq_(res, '')
assert self.viewer.selected['msg'].startswith('File size is')
开发者ID:atiqueahmedziad,项目名称:zamboni,代码行数:7,代码来源:test_helpers.py
示例8: test_solid_paletted_image
def test_solid_paletted_image(self):
img = Image.new('P', (100, 100), color=20)
palette = []
for i in range(256):
palette.extend((i, i//2, i%3))
img.putpalette(palette)
eq_(is_single_color_image(img), (20, 10, 2))
开发者ID:atrawog,项目名称:mapproxy,代码行数:7,代码来源:test_image.py
示例9: test_from_paletted
def test_from_paletted(self):
img = self._make_test_image().quantize(256)
img = make_transparent(img, (130, 150, 120), tolerance=5)
assert img.mode == 'RGBA'
assert img.size == (50, 50)
colors = img.getcolors()
eq_(colors, [(1600, (130, 140, 120, 255)), (900, (130, 150, 120, 0))])
开发者ID:atrawog,项目名称:mapproxy,代码行数:7,代码来源:test_image.py
示例10: test_seek_iter
def test_seek_iter(self):
self.rbuf_wrapper.seek(0)
data = list(self.rbuf_wrapper)
eq_(data, ['Hello World!'])
self.rbuf_wrapper.seek(0)
data = list(self.rbuf_wrapper)
eq_(data, ['Hello World!'])
开发者ID:atrawog,项目名称:mapproxy,代码行数:7,代码来源:test_image.py
示例11: test_solid_merge
def test_solid_merge(self):
img1 = ImageSource(Image.new('RGB', (10, 10), (255, 0, 255)))
img2 = ImageSource(Image.new('RGB', (10, 10), (0, 255, 255)))
result = merge_images([img1, img2], ImageOptions(transparent=False))
img = result.as_image()
eq_(img.getpixel((0, 0)), (0, 255, 255))
开发者ID:atrawog,项目名称:mapproxy,代码行数:7,代码来源:test_image.py
示例12: test_dir_with_status
def test_dir_with_status(self):
self.client.write('foo/bar', 'hello, world!')
statuses = self.client.list('foo', status=True)
eq_(len(statuses), 1)
status = self.client.status('foo/bar')
status['pathSuffix'] = 'bar'
eq_(statuses[0], ('bar', status))
开发者ID:e-heller,项目名称:hdfs,代码行数:7,代码来源:test_client.py
示例13: test_file_for_group
def test_file_for_group(self):
new_group = 'newgroup'
self.client.write('foo', 'hello, world!')
self.client.set_owner('foo', group='oldgroup')
self.client.set_owner('foo', group=new_group)
status = self.client.status('foo')
eq_(status['group'], new_group)
开发者ID:e-heller,项目名称:hdfs,代码行数:7,代码来源:test_client.py
示例14: test_directory_for_group
def test_directory_for_group(self):
new_group = 'newgroup'
self.client._mkdirs('foo')
self.client.set_owner('foo', group='oldgroup')
self.client.set_owner('foo', group=new_group)
status = self.client.status('foo')
eq_(status['group'], new_group)
开发者ID:e-heller,项目名称:hdfs,代码行数:7,代码来源:test_client.py
示例15: test_current_versions
def test_current_versions(self, rget):
model = models.CurrentVersions
api = model()
def mocked_get(**options):
assert '/products/' in options['url']
return Response("""
{"hits": {
"SeaMonkey": [{
"product": "SeaMonkey",
"throttle": "100.00",
"end_date": "2012-05-10 00:00:00",
"start_date": "2012-03-08 00:00:00",
"featured": true,
"version": "2.1.3pre",
"release": "Beta",
"id": 922}]
},
"products": ["SeaMonkey"]
}
""")
rget.side_effect = mocked_get
info = api.get()
ok_(isinstance(info, list))
ok_(isinstance(info[0], dict))
eq_(info[0]['product'], 'SeaMonkey')
开发者ID:GabiThume,项目名称:socorro-crashstats,代码行数:27,代码来源:test_models.py
示例16: test_some_pin
def test_some_pin(self):
self.solitude.generic.buyer.get_object_or_404.return_value = {
'pin': True}
res = self.client.get(self.url)
self.solitude.generic.buyer.get_object_or_404.assert_called_with(
headers={}, uuid='a')
eq_(json.loads(res.content)['pin'], True)
开发者ID:hudikwebb,项目名称:webpay,代码行数:7,代码来源:test_api.py
示例17: test_correlations_signatures
def test_correlations_signatures(self, rget):
model = models.CorrelationsSignatures
api = model()
def mocked_get(url, **options):
assert '/correlations/signatures' in url
ok_('/report_type/core-counts' in url)
return Response("""
{
"hits": ["FakeSignature1",
"FakeSignature2"],
"total": 2
}
""")
rget.side_effect = mocked_get
r = api.get(report_type='core-counts',
product='WaterWolf',
version='1.0a1',
platforms=['Windows NT', 'Linux'])
eq_(r['total'], 2)
r = api.get(report_type='core-counts',
product='WaterWolf',
version='1.0a1')
eq_(r['total'], 2)
开发者ID:GabiThume,项目名称:socorro-crashstats,代码行数:25,代码来源:test_models.py
示例18: test_no_user
def test_no_user(self):
self.solitude.generic.buyer.get_object_or_404.side_effect = (
ObjectDoesNotExist)
res = self.client.post(self.url, {'pin': '1234'})
self.solitude.generic.buyer.post.assert_called_with({'uuid': 'a',
'pin': '1234'})
eq_(res.status_code, 201)
开发者ID:hudikwebb,项目名称:webpay,代码行数:7,代码来源:test_api.py
示例19: test_bom
def test_bom(self):
dest = os.path.join(settings.TMP_PATH, 'test_bom')
open(dest, 'w').write('foo'.encode('utf-16'))
self.viewer.select('foo')
self.viewer.selected = {'full': dest, 'size': 1}
eq_(self.viewer.read_file(), u'foo')
os.remove(dest)
开发者ID:atiqueahmedziad,项目名称:zamboni,代码行数:7,代码来源:test_helpers.py
示例20: test_py_lang_files_defined
def test_py_lang_files_defined(self):
"""
If `LANG_FILES` is defined a list of the values should be returned.
"""
lang_files = langfiles_for_path('lib/l10n_utils/tests/test_files/'
'extract_me_with_langfiles.py')
eq_(lang_files, ['lebowski', 'dude'])
开发者ID:LeongWei,项目名称:bedrock,代码行数:7,代码来源:test_gettext.py
注:本文中的nose.tools.eq_函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论