Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(241) | Call(233) | Derive(0) | Import(8)
src/d/i/didjvu-0.2.7/tests/test_xmp.py didjvu(Download)
import os from . common import ( SkipTest, assert_equal,
def test_namespaces(): if libxmp is None: raise SkipTest(libxmp_import_error) assert_equal(libxmp.consts.XMP_NS_DC, ns.dc) assert_equal(libxmp.consts.XMP_NS_RDF, ns.rdf) assert_equal(libxmp.consts.XMP_NS_TIFF, ns.tiff) assert_equal(libxmp.consts.XMP_NS_XMP, ns.xmp)
src/a/s/astropy-0.3.1/astropy/io/ascii/tests/test_fixedwidth.py astropy(Download)
from ... import ascii as asciitable from .common import (assert_equal, assert_almost_equal, setup_function, teardown_function) def assert_equal_splitlines(arg1, arg2): assert_equal(arg1.splitlines(), arg2.splitlines())
reader = asciitable.get_reader(Reader=asciitable.FixedWidth) dat = reader.read(table) assert_equal(dat.colnames, ['Col1', 'Col2']) assert_almost_equal(dat[1][0], 2.4) assert_equal(dat[0][1], '"hello"') assert_equal(dat[1][1], "'s worlds")
src/a/s/astropy-0.3.1/astropy/io/ascii/tests/test_read_unicode.py astropy(Download)
from ....table import Table from .common import (raises, assert_equal, assert_almost_equal, assert_true, setup_function, teardown_function)
test_opts['guess'] = guess table = asciitable.read(testfile['name'], **test_opts) assert_equal(table.dtype.names, testfile['cols']) for colname in table.dtype.names: assert_equal(len(table[colname]), testfile['nrows'])
format = 'ascii' table = Table.read(testfile['name'], format=format, **test_opts) assert_equal(table.dtype.names, testfile['cols']) for colname in table.dtype.names: assert_equal(len(table[colname]), testfile['nrows'])
src/a/s/astropy-0.3.1/astropy/io/ascii/tests/test_read.py astropy(Download)
from ....table import Table from .common import (raises, assert_equal, assert_almost_equal, assert_true, setup_function, teardown_function)
test_opts['guess'] = guess table = asciitable.read(testfile['name'], **test_opts) assert_equal(table.dtype.names, testfile['cols']) for colname in table.dtype.names: assert_equal(len(table[colname]), testfile['nrows'])
format = 'ascii' table = Table.read(testfile['name'], format=format, **test_opts) assert_equal(table.dtype.names, testfile['cols']) for colname in table.dtype.names: assert_equal(len(table[colname]), testfile['nrows'])
src/a/s/astropy-0.3.1/astropy/io/ascii/tests/test_cds_header_from_readme.py astropy(Download)
# Licensed under a 3-clause BSD style license - see LICENSE.rst from ....tests.helper import pytest from ... import ascii as asciitable from .common import (assert_equal, assert_almost_equal, has_isnan,
for read_table in (read_table1, read_table2, read_table3): table = read_table(readme, data) assert_equal(len(table), 18) assert_almost_equal(table['Lambda'][-1], 6479.32) assert_equal(table['Fnu'][-1], '0.285937')
for read_table in (read_table1, read_table2, read_table3): table = read_table(readme, data) assert_equal(len(table), 291) assert_equal(table['Name'][-1], 'J1914+0953') assert_equal(table['BibCode'][-2], '2005A&A...432..235R')
src/a/s/astropy-0.3.1/astropy/io/ascii/tests/test_types.py astropy(Download)
from ... import ascii as asciitable from .common import assert_equal, setup_function, teardown_function
asciitable.write(dat, out, Writer=asciitable.Rdb) outs = out.getvalue().splitlines() assert_equal(outs[1], 'N\tN\tS\tN')
asciitable.StrType] for (col, expected_type) in zip(reader.cols, types): assert_equal(col.type, expected_type)
src/t/a/tabulate-0.7.2/test/test_output.py tabulate(Download)
from __future__ import unicode_literals from tabulate import tabulate, simple_separated_format from common import assert_equal
'eggs 451',]) result = tabulate(_test_table, _test_table_headers, tablefmt="plain") assert_equal(expected, result)
'eggs 451',]) result = tabulate(_test_table, tablefmt="plain") assert_equal(expected, result)
'eggs 451',]) result = tabulate(_test_table, _test_table_headers, tablefmt="simple") assert_equal(expected, result)
'---- --------',]) result = tabulate(_test_table, tablefmt="simple") assert_equal(expected, result)
src/t/a/tabulate-0.7.2/test/test_regression.py tabulate(Download)
from __future__ import unicode_literals from tabulate import tabulate from common import assert_equal
'| test | \x1b[31mtest\x1b[0m | \x1b[32mtest\x1b[0m |']) print("expected: %r\n\ngot: %r\n" % (expected, formatted)) assert_equal(expected, formatted)
'+--------+--------+--------+']) print("expected: %r\n\ngot: %r\n" % (expected, formatted)) assert_equal(expected, formatted)
' 0 1 2']) print("expected: %r\n\ngot: %r\n" % (expected, formatted)) assert_equal(expected, formatted)
'------------------- ---------- --------']) print("expected: %r\n\ngot: %r\n" % (expected, formatted)) assert_equal(expected, formatted)