Skip to content

Instantly share code, notes, and snippets.

@jamiekt
Created March 15, 2016 20:25
Show Gist options
  • Save jamiekt/c1b6d4c4d15b125d9599 to your computer and use it in GitHub Desktop.
Save jamiekt/c1b6d4c4d15b125d9599 to your computer and use it in GitHub Desktop.
GLOB sdist-make: C:\git\github\datapackages\datapackage-py\setup.py
py27 inst-nodeps: C:\git\github\datapackages\datapackage-py\.tox\dist\datapackage-0.0.1.zip
py27 installed: chardet==2.3.0,click==6.3,colorama==0.3.7,coverage==4.0.3,coveralls==1.1,datapackage==0.0.1,docopt==0.6.2,et-xmlfile==1.0.1,funcsigs==0.4,functools32==3.2.3.post2,future==0.15.2,httpretty==0.8.10,ijson==2.3,jdcal==1.2,jsonschema==2.5.1,jsontableschema==0.5.1,mock==1.3.0,openpyxl==2.3.3,pbr==1.8.1,py==1.4.31,pytest==2.9.0,pytest-cov==2.2.1,python-dateutil==2.5.0,requests==2.9.1,rfc3987==1.3.5,six==1.10.0,tabulator==0.3.6,xlrd==0.9.4
py27 runtests: PYTHONHASHSEED='761'
py27 runtests: commands[0] | py.test --cov datapackage --cov-report term-missing --cov-config .coveragerc
============================= test session starts =============================
platform win32 -- Python 2.7.10, pytest-2.9.0, py-1.4.31, pluggy-0.3.1
rootdir: C:\git\github\datapackages\datapackage-py, inifile: pytest.ini
plugins: cov-2.2.1
collected 189 items
tests\test_datapackage.py ..................................FF........F...FFF....EEEEEFFF.....FEF
tests\test_registry.py ...........F...F......
tests\test_resource.py .........FF..F.........F....F..F..........F......F.
tests\test_resource_file.py F.FF..F.FF....F.FF....
tests\test_schema.py .......................
--------------- coverage: platform win32, python 2.7.10-final-0 ---------------
Name Stmts Miss Cover Missing
------------------------------------------------------------
datapackage\__init__.py 2 0 100%
datapackage\datapackage.py 170 14 92% 152, 259-261, 264-272, 287-291, 360
datapackage\exceptions.py 13 0 100%
datapackage\registry.py 75 8 89% 94-104, 142
datapackage\resource.py 166 6 96% 111, 174, 176, 275, 277, 279
datapackage\resource_file.py 55 0 100%
datapackage\schema.py 73 0 100%
------------------------------------------------------------
TOTAL 554 28 95%
=================================== ERRORS ====================================
ERROR at setup of TestImportingDataPackageFromZip.test_it_works_with_local_paths
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x02C79C28>
@pytest.fixture
def datapackage_zip(tmpfile):
metadata = {
'name': 'proverbs',
'resources': [
{'path': test_helpers.fixture_path('foo.txt')},
]
}
dp = datapackage.DataPackage(metadata)
> dp.save(tmpfile)
tests\test_datapackage.py:677:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\datapackage.py:197: in save
self.validate()
datapackage\datapackage.py:230: in validate
self.schema.validate(self.to_dict())
datapackage\schema.py:54: in validate
self._validator.validate(data)
.tox\py27\lib\site-packages\jsonschema\validators.py:122: in validate
for error in self.iter_errors(*args, **kwargs):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:291: in properties_draft4
schema_path=property,
.tox\py27\lib\site-packages\jsonschema\validators.py:114: in descend
for error in self.iter_errors(instance, schema):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:199: in ref
scope, resolved = validator.resolver.resolve(ref)
.tox\py27\lib\site-packages\jsonschema\validators.py:336: in resolve
return url, self._remote_cache(url)
.tox\py27\lib\site-packages\functools32\functools32.py:400: in wrapper
result = user_function(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jsonschema.validators.RefResolver object at 0x04100DB0>
url = 'file://C:\git\github\datapackages\datapackage-py\datapackage\schemas/definitions.json'
def resolve_from_url(self, url):
url, fragment = urldefrag(url)
try:
document = self.store[url]
except KeyError:
try:
document = self.resolve_remote(url)
except Exception as exc:
> raise RefResolutionError(exc)
E RefResolutionError: <urlopen error [Error 2] The system cannot find the file specified: u'\\definitions.json'>
.tox\py27\lib\site-packages\jsonschema\validators.py:346: RefResolutionError
ERROR at setup of TestImportingDataPackageFromZip.test_it_works_with_file_objects
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x041A24F0>
@pytest.fixture
def datapackage_zip(tmpfile):
metadata = {
'name': 'proverbs',
'resources': [
{'path': test_helpers.fixture_path('foo.txt')},
]
}
dp = datapackage.DataPackage(metadata)
> dp.save(tmpfile)
tests\test_datapackage.py:677:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\datapackage.py:197: in save
self.validate()
datapackage\datapackage.py:230: in validate
self.schema.validate(self.to_dict())
datapackage\schema.py:54: in validate
self._validator.validate(data)
.tox\py27\lib\site-packages\jsonschema\validators.py:122: in validate
for error in self.iter_errors(*args, **kwargs):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:291: in properties_draft4
schema_path=property,
.tox\py27\lib\site-packages\jsonschema\validators.py:114: in descend
for error in self.iter_errors(instance, schema):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:199: in ref
scope, resolved = validator.resolver.resolve(ref)
.tox\py27\lib\site-packages\jsonschema\validators.py:336: in resolve
return url, self._remote_cache(url)
.tox\py27\lib\site-packages\functools32\functools32.py:400: in wrapper
result = user_function(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jsonschema.validators.RefResolver object at 0x04157FD0>
url = 'file://C:\git\github\datapackages\datapackage-py\datapackage\schemas/definitions.json'
def resolve_from_url(self, url):
url, fragment = urldefrag(url)
try:
document = self.store[url]
except KeyError:
try:
document = self.resolve_remote(url)
except Exception as exc:
> raise RefResolutionError(exc)
E RefResolutionError: <urlopen error [Error 2] The system cannot find the file specified: u'\\definitions.json'>
.tox\py27\lib\site-packages\jsonschema\validators.py:346: RefResolutionError
ERROR at setup of TestImportingDataPackageFromZip.test_it_works_with_remote_files
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x041A2758>
@pytest.fixture
def datapackage_zip(tmpfile):
metadata = {
'name': 'proverbs',
'resources': [
{'path': test_helpers.fixture_path('foo.txt')},
]
}
dp = datapackage.DataPackage(metadata)
> dp.save(tmpfile)
tests\test_datapackage.py:677:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\datapackage.py:197: in save
self.validate()
datapackage\datapackage.py:230: in validate
self.schema.validate(self.to_dict())
datapackage\schema.py:54: in validate
self._validator.validate(data)
.tox\py27\lib\site-packages\jsonschema\validators.py:122: in validate
for error in self.iter_errors(*args, **kwargs):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:291: in properties_draft4
schema_path=property,
.tox\py27\lib\site-packages\jsonschema\validators.py:114: in descend
for error in self.iter_errors(instance, schema):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:199: in ref
scope, resolved = validator.resolver.resolve(ref)
.tox\py27\lib\site-packages\jsonschema\validators.py:336: in resolve
return url, self._remote_cache(url)
.tox\py27\lib\site-packages\functools32\functools32.py:400: in wrapper
result = user_function(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jsonschema.validators.RefResolver object at 0x03FFE7F0>
url = 'file://C:\git\github\datapackages\datapackage-py\datapackage\schemas/definitions.json'
def resolve_from_url(self, url):
url, fragment = urldefrag(url)
try:
document = self.store[url]
except KeyError:
try:
document = self.resolve_remote(url)
except Exception as exc:
> raise RefResolutionError(exc)
E RefResolutionError: <urlopen error [Error 2] The system cannot find the file specified: u'\\definitions.json'>
.tox\py27\lib\site-packages\jsonschema\validators.py:346: RefResolutionError
ERROR at setup of TestImportingDataPackageFromZip.test_it_removes_temporary_directories
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x041A29C0>
@pytest.fixture
def datapackage_zip(tmpfile):
metadata = {
'name': 'proverbs',
'resources': [
{'path': test_helpers.fixture_path('foo.txt')},
]
}
dp = datapackage.DataPackage(metadata)
> dp.save(tmpfile)
tests\test_datapackage.py:677:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\datapackage.py:197: in save
self.validate()
datapackage\datapackage.py:230: in validate
self.schema.validate(self.to_dict())
datapackage\schema.py:54: in validate
self._validator.validate(data)
.tox\py27\lib\site-packages\jsonschema\validators.py:122: in validate
for error in self.iter_errors(*args, **kwargs):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:291: in properties_draft4
schema_path=property,
.tox\py27\lib\site-packages\jsonschema\validators.py:114: in descend
for error in self.iter_errors(instance, schema):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:199: in ref
scope, resolved = validator.resolver.resolve(ref)
.tox\py27\lib\site-packages\jsonschema\validators.py:336: in resolve
return url, self._remote_cache(url)
.tox\py27\lib\site-packages\functools32\functools32.py:400: in wrapper
result = user_function(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jsonschema.validators.RefResolver object at 0x03FECBD0>
url = 'file://C:\git\github\datapackages\datapackage-py\datapackage\schemas/definitions.json'
def resolve_from_url(self, url):
url, fragment = urldefrag(url)
try:
document = self.store[url]
except KeyError:
try:
document = self.resolve_remote(url)
except Exception as exc:
> raise RefResolutionError(exc)
E RefResolutionError: <urlopen error [Error 2] The system cannot find the file specified: u'\\definitions.json'>
.tox\py27\lib\site-packages\jsonschema\validators.py:346: RefResolutionError
___ ERROR at setup of TestImportingDataPackageFromZip.test_local_data_path ____
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x041A2AC8>
@pytest.fixture
def datapackage_zip(tmpfile):
metadata = {
'name': 'proverbs',
'resources': [
{'path': test_helpers.fixture_path('foo.txt')},
]
}
dp = datapackage.DataPackage(metadata)
> dp.save(tmpfile)
tests\test_datapackage.py:677:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\datapackage.py:197: in save
self.validate()
datapackage\datapackage.py:230: in validate
self.schema.validate(self.to_dict())
datapackage\schema.py:54: in validate
self._validator.validate(data)
.tox\py27\lib\site-packages\jsonschema\validators.py:122: in validate
for error in self.iter_errors(*args, **kwargs):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:291: in properties_draft4
schema_path=property,
.tox\py27\lib\site-packages\jsonschema\validators.py:114: in descend
for error in self.iter_errors(instance, schema):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:199: in ref
scope, resolved = validator.resolver.resolve(ref)
.tox\py27\lib\site-packages\jsonschema\validators.py:336: in resolve
return url, self._remote_cache(url)
.tox\py27\lib\site-packages\functools32\functools32.py:400: in wrapper
result = user_function(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jsonschema.validators.RefResolver object at 0x04157590>
url = 'file://C:\git\github\datapackages\datapackage-py\datapackage\schemas/definitions.json'
def resolve_from_url(self, url):
url, fragment = urldefrag(url)
try:
document = self.store[url]
except KeyError:
try:
document = self.resolve_remote(url)
except Exception as exc:
> raise RefResolutionError(exc)
E RefResolutionError: <urlopen error [Error 2] The system cannot find the file specified: u'\\definitions.json'>
.tox\py27\lib\site-packages\jsonschema\validators.py:346: RefResolutionError
ERROR at setup of TestSafeDataPackage.test_zip_with_relative_resources_paths_is_safe
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x04151C80>
@pytest.fixture
def datapackage_zip(tmpfile):
metadata = {
'name': 'proverbs',
'resources': [
{'path': test_helpers.fixture_path('foo.txt')},
]
}
dp = datapackage.DataPackage(metadata)
> dp.save(tmpfile)
tests\test_datapackage.py:677:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\datapackage.py:197: in save
self.validate()
datapackage\datapackage.py:230: in validate
self.schema.validate(self.to_dict())
datapackage\schema.py:54: in validate
self._validator.validate(data)
.tox\py27\lib\site-packages\jsonschema\validators.py:122: in validate
for error in self.iter_errors(*args, **kwargs):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:291: in properties_draft4
schema_path=property,
.tox\py27\lib\site-packages\jsonschema\validators.py:114: in descend
for error in self.iter_errors(instance, schema):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:199: in ref
scope, resolved = validator.resolver.resolve(ref)
.tox\py27\lib\site-packages\jsonschema\validators.py:336: in resolve
return url, self._remote_cache(url)
.tox\py27\lib\site-packages\functools32\functools32.py:400: in wrapper
result = user_function(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jsonschema.validators.RefResolver object at 0x03FEC250>
url = 'file://C:\git\github\datapackages\datapackage-py\datapackage\schemas/definitions.json'
def resolve_from_url(self, url):
url, fragment = urldefrag(url)
try:
document = self.store[url]
except KeyError:
try:
document = self.resolve_remote(url)
except Exception as exc:
> raise RefResolutionError(exc)
E RefResolutionError: <urlopen error [Error 2] The system cannot find the file specified: u'\\definitions.json'>
.tox\py27\lib\site-packages\jsonschema\validators.py:346: RefResolutionError
================================== FAILURES ===================================
__ TestDataPackageResources.test_local_resource_with_absolute_path_is_loaded __
self = <tests.test_datapackage.TestDataPackageResources object at 0x03FF52B0>
def test_local_resource_with_absolute_path_is_loaded(self):
path = test_helpers.fixture_path('foo.txt')
metadata = {
'resources': [
{'path': path},
],
}
dp = datapackage.DataPackage(metadata)
assert len(dp.resources) == 1
> assert dp.resources[0].data == b'foo\n'
E assert 'foo\r\n' == 'foo\n'
E - foo\r
E ? --
E + foo
tests\test_datapackage.py:302: AssertionError
__ TestDataPackageResources.test_local_resource_with_relative_path_is_loaded __
self = <tests.test_datapackage.TestDataPackageResources object at 0x03FE7EB0>
def test_local_resource_with_relative_path_is_loaded(self):
datapackage_filename = 'datapackage_with_foo.txt_resource.json'
path = test_helpers.fixture_path(datapackage_filename)
dp = datapackage.DataPackage(path)
assert len(dp.resources) == 1
> assert dp.resources[0].data == b'foo\n'
E assert 'foo\r\n' == 'foo\n'
E - foo\r
E ? --
E + foo
tests\test_datapackage.py:309: AssertionError
_______________ TestSavingDataPackages.test_accepts_file_paths ________________
self = <tests.test_datapackage.TestSavingDataPackages object at 0x03FF5650>
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x03FD4A18>
def test_accepts_file_paths(self, tmpfile):
dp = datapackage.DataPackage(schema={})
> dp.save(tmpfile.name)
tests\test_datapackage.py:395:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\datapackage.py:222: in save
six.raise_from(DataPackageException(e), e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
value = DataPackageException(IOError(13, 'Permission denied'),)
from_value = IOError(13, 'Permission denied')
def raise_from(value, from_value):
> raise value
E DataPackageException: [Errno 13] Permission denied: 'c:\\users\\jamie\\appdata\\local\\temp\\tmpqbn7an'
.tox\py27\lib\site-packages\six.py:718: DataPackageException
______ TestSavingDataPackages.test_adds_resources_inside_data_subfolder _______
self = <tests.test_datapackage.TestSavingDataPackages object at 0x03FFE170>
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x02C50BD0>
def test_adds_resources_inside_data_subfolder(self, tmpfile):
resource_path = test_helpers.fixture_path('unicode.txt')
metadata = {
'name': 'proverbs',
'resources': [
{'path': resource_path}
]
}
schema = {}
dp = datapackage.DataPackage(metadata, schema)
dp.save(tmpfile)
with zipfile.ZipFile(tmpfile, 'r') as z:
filename = [name for name in z.namelist()
if name.startswith('data/')]
assert len(filename) == 1
resource_data = z.read(filename[0]).decode('utf-8')
> assert resource_data == 'õ©çõ║ïÕ╝ÇÕñ┤ÚÜ¥\n'
E assert '\u4e07\u4e8b\u5f00\u5934\u96be\r\\n' == '\u4e07\u4e8b\u5f00\u5934\u96be\\n'
E \u4e07\u4e8b\u5f00\u5934\u96be
tests\test_datapackage.py:459: AssertionError
_ TestSavingDataPackages.test_fixes_resources_paths_to_be_relative_to_package _
self = <tests.test_datapackage.TestSavingDataPackages object at 0x03FCCE10>
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x04058548>
def test_fixes_resources_paths_to_be_relative_to_package(self, tmpfile):
resource_path = test_helpers.fixture_path('unicode.txt')
metadata = {
'name': 'proverbs',
'resources': [
{'name': 'unicode', 'format': 'txt', 'path': resource_path}
]
}
schema = {}
dp = datapackage.DataPackage(metadata, schema)
dp.save(tmpfile)
with zipfile.ZipFile(tmpfile, 'r') as z:
json_string = z.read('datapackage.json').decode('utf-8')
generated_dp_dict = json.loads(json_string)
> assert generated_dp_dict['resources'][0]['path'] == 'data/unicode.txt'
E assert 'data\unicode.txt' == 'data/unicode.txt'
E - data\unicode.txt
E ? ^
E + data/unicode.txt
E ? ^
tests\test_datapackage.py:475: AssertionError
____ TestSavingDataPackages.test_works_with_resources_with_relative_paths _____
self = <tests.test_datapackage.TestSavingDataPackages object at 0x03F68C30>
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x040588B8>
def test_works_with_resources_with_relative_paths(self, tmpfile):
path = test_helpers.fixture_path(
'datapackage_with_foo.txt_resource.json'
)
dp = datapackage.DataPackage(path)
> dp.save(tmpfile)
tests\test_datapackage.py:482:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\datapackage.py:197: in save
self.validate()
datapackage\datapackage.py:230: in validate
self.schema.validate(self.to_dict())
datapackage\schema.py:54: in validate
self._validator.validate(data)
.tox\py27\lib\site-packages\jsonschema\validators.py:122: in validate
for error in self.iter_errors(*args, **kwargs):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:291: in properties_draft4
schema_path=property,
.tox\py27\lib\site-packages\jsonschema\validators.py:114: in descend
for error in self.iter_errors(instance, schema):
.tox\py27\lib\site-packages\jsonschema\validators.py:98: in iter_errors
for error in errors:
.tox\py27\lib\site-packages\jsonschema\_validators.py:199: in ref
scope, resolved = validator.resolver.resolve(ref)
.tox\py27\lib\site-packages\jsonschema\validators.py:336: in resolve
return url, self._remote_cache(url)
.tox\py27\lib\site-packages\functools32\functools32.py:400: in wrapper
result = user_function(*args, **kwds)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jsonschema.validators.RefResolver object at 0x04054290>
url = 'file://C:\git\github\datapackages\datapackage-py\datapackage\schemas/definitions.json'
def resolve_from_url(self, url):
url, fragment = urldefrag(url)
try:
document = self.store[url]
except KeyError:
try:
document = self.resolve_remote(url)
except Exception as exc:
> raise RefResolutionError(exc)
E RefResolutionError: <urlopen error [Error 2] The system cannot find the file specified: u'\\definitions.json'>
.tox\py27\lib\site-packages\jsonschema\validators.py:346: RefResolutionError
TestImportingDataPackageFromZip.test_it_can_load_from_zip_files_inner_folders
self = <tests.test_datapackage.TestImportingDataPackageFromZip object at 0x03FCC370>
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x041A2F98>
def test_it_can_load_from_zip_files_inner_folders(self, tmpfile):
metadata = {
'name': 'foo',
}
> with zipfile.ZipFile(tmpfile.name, 'w') as z:
tests\test_datapackage.py:576:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <zipfile.ZipFile object at 0x03FCCAB0>
file = 'c:\\users\\jamie\\appdata\\local\\temp\\tmpmbcybh', mode = 'w'
compression = 0, allowZip64 = False
def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=False):
"""Open the ZIP file with mode read "r", write "w" or append "a"."""
if mode not in ("r", "w", "a"):
raise RuntimeError('ZipFile() requires mode "r", "w", or "a"')
if compression == ZIP_STORED:
pass
elif compression == ZIP_DEFLATED:
if not zlib:
raise RuntimeError,\
"Compression requires the (missing) zlib module"
else:
raise RuntimeError, "That compression method is not supported"
self._allowZip64 = allowZip64
self._didModify = False
self.debug = 0 # Level of printing: 0 through 3
self.NameToInfo = {} # Find file info given name
self.filelist = [] # List of ZipInfo instances for archive
self.compression = compression # Method of compression
self.mode = key = mode.replace('b', '')[0]
self.pwd = None
self._comment = ''
# Check if we were passed a file-like object
if isinstance(file, basestring):
self._filePassed = 0
self.filename = file
modeDict = {'r' : 'rb', 'w': 'wb', 'a' : 'r+b'}
try:
> self.fp = open(file, modeDict[mode])
E IOError: [Errno 13] Permission denied: 'c:\\users\\jamie\\appdata\\local\\temp\\tmpmbcybh'
c:\python27\Lib\zipfile.py:756: IOError
TestImportingDataPackageFromZip.test_it_breaks_if_theres_no_datapackage_json _
self = <tests.test_datapackage.TestImportingDataPackageFromZip object at 0x04100490>
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x041A2A18>
def test_it_breaks_if_theres_no_datapackage_json(self, tmpfile):
> with zipfile.ZipFile(tmpfile.name, 'w') as z:
tests\test_datapackage.py:582:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <zipfile.ZipFile object at 0x04100350>
file = 'c:\\users\\jamie\\appdata\\local\\temp\\tmpnas1tf', mode = 'w'
compression = 0, allowZip64 = False
def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=False):
"""Open the ZIP file with mode read "r", write "w" or append "a"."""
if mode not in ("r", "w", "a"):
raise RuntimeError('ZipFile() requires mode "r", "w", or "a"')
if compression == ZIP_STORED:
pass
elif compression == ZIP_DEFLATED:
if not zlib:
raise RuntimeError,\
"Compression requires the (missing) zlib module"
else:
raise RuntimeError, "That compression method is not supported"
self._allowZip64 = allowZip64
self._didModify = False
self.debug = 0 # Level of printing: 0 through 3
self.NameToInfo = {} # Find file info given name
self.filelist = [] # List of ZipInfo instances for archive
self.compression = compression # Method of compression
self.mode = key = mode.replace('b', '')[0]
self.pwd = None
self._comment = ''
# Check if we were passed a file-like object
if isinstance(file, basestring):
self._filePassed = 0
self.filename = file
modeDict = {'r' : 'rb', 'w': 'wb', 'a' : 'r+b'}
try:
> self.fp = open(file, modeDict[mode])
E IOError: [Errno 13] Permission denied: 'c:\\users\\jamie\\appdata\\local\\temp\\tmpnas1tf'
c:\python27\Lib\zipfile.py:756: IOError
TestImportingDataPackageFromZip.test_it_breaks_if_theres_more_than_one_datapackage_json
self = <tests.test_datapackage.TestImportingDataPackageFromZip object at 0x0407FC50>
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x040A5EE8>
def test_it_breaks_if_theres_more_than_one_datapackage_json(self, tmpfile):
metadata_foo = {
'name': 'foo',
}
metadata_bar = {
'name': 'bar',
}
> with zipfile.ZipFile(tmpfile.name, 'w') as z:
tests\test_datapackage.py:594:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <zipfile.ZipFile object at 0x0407F4F0>
file = 'c:\\users\\jamie\\appdata\\local\\temp\\tmp08vgtt', mode = 'w'
compression = 0, allowZip64 = False
def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=False):
"""Open the ZIP file with mode read "r", write "w" or append "a"."""
if mode not in ("r", "w", "a"):
raise RuntimeError('ZipFile() requires mode "r", "w", or "a"')
if compression == ZIP_STORED:
pass
elif compression == ZIP_DEFLATED:
if not zlib:
raise RuntimeError,\
"Compression requires the (missing) zlib module"
else:
raise RuntimeError, "That compression method is not supported"
self._allowZip64 = allowZip64
self._didModify = False
self.debug = 0 # Level of printing: 0 through 3
self.NameToInfo = {} # Find file info given name
self.filelist = [] # List of ZipInfo instances for archive
self.compression = compression # Method of compression
self.mode = key = mode.replace('b', '')[0]
self.pwd = None
self._comment = ''
# Check if we were passed a file-like object
if isinstance(file, basestring):
self._filePassed = 0
self.filename = file
modeDict = {'r' : 'rb', 'w': 'wb', 'a' : 'r+b'}
try:
> self.fp = open(file, modeDict[mode])
E IOError: [Errno 13] Permission denied: 'c:\\users\\jamie\\appdata\\local\\temp\\tmp08vgtt'
c:\python27\Lib\zipfile.py:756: IOError
__ TestSafeDataPackage.test_local_with_resources_outside_base_path_isnt_safe __
self = <tests.test_datapackage.TestSafeDataPackage object at 0x03FCC510>
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x040A5DE0>
def test_local_with_resources_outside_base_path_isnt_safe(self, tmpfile):
metadata = {
'resources': [
{'path': __file__},
]
}
tmpfile.write(json.dumps(metadata).encode('utf-8'))
tmpfile.flush()
> dp = datapackage.DataPackage(tmpfile.name, {})
tests\test_datapackage.py:649:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\datapackage.py:56: in __init__
self._metadata = self._load_metadata(metadata)
datapackage\datapackage.py:312: in _load_metadata
six.raise_from(DataPackageException(msg), e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
value = DataPackageException(u"Unable to load JSON at 'c:\\users\\jamie\\appdata\\local\\temp\\tmp9jqhvy'",)
from_value = IOError(13, 'Permission denied')
def raise_from(value, from_value):
> raise value
E DataPackageException: Unable to load JSON at 'c:\users\jamie\appdata\local\temp\tmp9jqhvy'
.tox\py27\lib\site-packages\six.py:718: DataPackageException
___ TestSafeDataPackage.test_zip_with_resources_outside_base_path_isnt_safe ___
self = <tests.test_datapackage.TestSafeDataPackage object at 0x03FE47B0>
tmpfile = <open file '<fdopen>', mode 'w+b' at 0x04151B20>
def test_zip_with_resources_outside_base_path_isnt_safe(self, tmpfile):
metadata = {
'resources': [
{'path': __file__},
]
}
> with zipfile.ZipFile(tmpfile.name, 'w') as z:
tests\test_datapackage.py:662:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <zipfile.ZipFile object at 0x03FE4990>
file = 'c:\\users\\jamie\\appdata\\local\\temp\\tmpl76fez', mode = 'w'
compression = 0, allowZip64 = False
def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=False):
"""Open the ZIP file with mode read "r", write "w" or append "a"."""
if mode not in ("r", "w", "a"):
raise RuntimeError('ZipFile() requires mode "r", "w", or "a"')
if compression == ZIP_STORED:
pass
elif compression == ZIP_DEFLATED:
if not zlib:
raise RuntimeError,\
"Compression requires the (missing) zlib module"
else:
raise RuntimeError, "That compression method is not supported"
self._allowZip64 = allowZip64
self._didModify = False
self.debug = 0 # Level of printing: 0 through 3
self.NameToInfo = {} # Find file info given name
self.filelist = [] # List of ZipInfo instances for archive
self.compression = compression # Method of compression
self.mode = key = mode.replace('b', '')[0]
self.pwd = None
self._comment = ''
# Check if we were passed a file-like object
if isinstance(file, basestring):
self._filePassed = 0
self.filename = file
modeDict = {'r' : 'rb', 'w': 'wb', 'a' : 'r+b'}
try:
> self.fp = open(file, modeDict[mode])
E IOError: [Errno 13] Permission denied: 'c:\\users\\jamie\\appdata\\local\\temp\\tmpl76fez'
c:\python27\Lib\zipfile.py:756: IOError
_____ TestRegistry.test_get_loads_remote_file_if_local_copy_doesnt_exist ______
args = (<tests.test_registry.TestRegistry object at 0x03FBC4B0>,), kw = {}
@functools.wraps(test)
def wrapper(*args, **kw):
httpretty.reset()
httpretty.enable()
try:
> return test(*args, **kw)
.tox\py27\lib\site-packages\httpretty\core.py:1063:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\test_registry.py:154: in test_get_loads_remote_file_if_local_copy_doesnt_exist
registry = datapackage.registry.Registry(tmpfile.name)
datapackage\registry.py:44: in __init__
six.raise_from(RegistryError(e), e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
value = RegistryError(IOError(13, 'Permission denied'),)
from_value = IOError(13, 'Permission denied')
def raise_from(value, from_value):
> raise value
E RegistryError: [Errno 13] Permission denied: u'c:\\users\\jamie\\appdata\\local\\temp\\tmpidicum.csv'
.tox\py27\lib\site-packages\six.py:718: RegistryError
_______ TestRegistry.test_get_raises_if_local_profile_file_doesnt_exist _______
args = (<tests.test_registry.TestRegistry object at 0x03FCC390>,), kw = {}
@functools.wraps(test)
def wrapper(*args, **kw):
httpretty.reset()
httpretty.enable()
try:
> return test(*args, **kw)
.tox\py27\lib\site-packages\httpretty\core.py:1063:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\test_registry.py:193: in test_get_raises_if_local_profile_file_doesnt_exist
registry = datapackage.registry.Registry(tmpfile.name)
datapackage\registry.py:44: in __init__
six.raise_from(RegistryError(e), e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
value = RegistryError(IOError(13, 'Permission denied'),)
from_value = IOError(13, 'Permission denied')
def raise_from(value, from_value):
> raise value
E RegistryError: [Errno 13] Permission denied: u'c:\\users\\jamie\\appdata\\local\\temp\\tmpi0ig3f.csv'
.tox\py27\lib\site-packages\six.py:718: RegistryError
________________ TestResource.test_load_accepts_absolute_paths ________________
self = <tests.test_resource.TestResource object at 0x0407FC10>
def test_load_accepts_absolute_paths(self):
path = test_helpers.fixture_path('foo.txt')
resource_dict = {
'path': path,
}
resource = datapackage.Resource.load(resource_dict)
> assert resource.data == b'foo\n'
E assert 'foo\r\n' == 'foo\n'
E - foo\r
E ? --
E + foo
tests\test_resource.py:149: AssertionError
________________ TestResource.test_load_accepts_relative_paths ________________
self = <tests.test_resource.TestResource object at 0x0419D830>
def test_load_accepts_relative_paths(self):
filename = 'foo.txt'
base_path = os.path.dirname(
test_helpers.fixture_path(filename)
)
resource_dict = {
'path': filename,
}
resource = datapackage.Resource.load(resource_dict, base_path)
> assert resource.data == b'foo\n'
E assert 'foo\r\n' == 'foo\n'
E - foo\r
E ? --
E + foo
tests\test_resource.py:160: AssertionError
____________ TestResource.test_can_change_data_path_after_creation ____________
self = <tests.test_resource.TestResource object at 0x040138F0>
def test_can_change_data_path_after_creation(self):
original_path = test_helpers.fixture_path('unicode.txt')
new_path = test_helpers.fixture_path('foo.txt')
resource_dict = {
'path': original_path
}
resource = datapackage.Resource.load(resource_dict)
resource.metadata['path'] = new_path
> assert resource.data == b'foo\n'
E assert 'foo\r\n' == 'foo\n'
E - foo\r
E ? --
E + foo
tests\test_resource.py:214: AssertionError
_________________ TestResource.test_iterator_with_local_data __________________
self = <tests.test_resource.TestResource object at 0x03F68910>
txt_tmpfile = <open file '<fdopen>', mode 'w+b' at 0x04181AC8>
def test_iterator_with_local_data(self, txt_tmpfile):
contents = (
'first line\n'
'second line\n'
)
txt_tmpfile.write(contents.encode('utf-8'))
txt_tmpfile.flush()
resource = datapackage.Resource.load({'path': txt_tmpfile.name})
> data = [row for row in resource.iter()]
tests\test_resource.py:314:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\resource.py:138: in iter
if self._resource_file:
datapackage\resource.py:116: in _resource_file
resource_file = self._load_resource_file()
datapackage\resource.py:167: in _load_resource_file
return LocalResourceFile(self.local_data_path)
datapackage\resource_file.py:32: in __init__
self._file = self._load_file(path)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <datapackage.resource_file.LocalResourceFile object at 0x03F68670>
path = 'c:\users\jamie\appdata\local\temp\tmpki_elo.txt'
def _load_file(self, path):
> return open(path, 'rb')
E IOError: [Errno 13] Permission denied: u'c:\\users\\jamie\\appdata\\local\\temp\\tmpki_elo.txt'
datapackage\resource_file.py:36: IOError
_________ TestResource.test_load_prefers_loading_local_data_over_url __________
args = (<tests.test_resource.TestResource object at 0x04013AB0>,), kw = {}
@functools.wraps(test)
def wrapper(*args, **kw):
httpretty.reset()
httpretty.enable()
try:
> return test(*args, **kw)
.tox\py27\lib\site-packages\httpretty\core.py:1063:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.test_resource.TestResource object at 0x04013AB0>
@httpretty.activate
def test_load_prefers_loading_local_data_over_url(self):
httpretty.HTTPretty.allow_net_connect = False
resource_dict = {
'path': test_helpers.fixture_path('foo.txt'),
'url': 'http://someplace.com/inexistent-file.txt',
}
resource = datapackage.Resource.load(resource_dict)
> assert resource.data == b'foo\n'
E assert 'foo\r\n' == 'foo\n'
E - foo\r
E ? --
E + foo
tests\test_resource.py:109: AssertionError
________________ TestResource.test_load_accepts_relative_urls _________________
args = (<tests.test_resource.TestResource object at 0x04054570>,), kw = {}
@functools.wraps(test)
def wrapper(*args, **kw):
httpretty.reset()
httpretty.enable()
try:
> return test(*args, **kw)
.tox\py27\lib\site-packages\httpretty\core.py:1063:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\test_resource.py:184: in test_load_accepts_relative_urls
assert resource.data == b'foo'
datapackage\resource.py:82: in data
self._data = self._parse_data(self.metadata)
datapackage\resource.py:182: in _parse_data
return self._load_data()
datapackage\resource.py:185: in _load_data
if self._resource_file:
datapackage\resource.py:116: in _resource_file
resource_file = self._load_resource_file()
datapackage\resource.py:170: in _load_resource_file
return RemoteResourceFile(self.remote_data_path)
datapackage\resource_file.py:54: in __init__
self._file = self._load_file(url)
datapackage\resource_file.py:59: in _load_file
res = requests.get(url, stream=True)
.tox\py27\lib\site-packages\requests\api.py:67: in get
return request('get', url, params=params, **kwargs)
.tox\py27\lib\site-packages\requests\api.py:53: in request
return session.request(method=method, url=url, **kwargs)
.tox\py27\lib\site-packages\requests\sessions.py:468: in request
resp = self.send(prep, **send_kwargs)
.tox\py27\lib\site-packages\requests\sessions.py:576: in send
r = adapter.send(request, **kwargs)
.tox\py27\lib\site-packages\requests\adapters.py:376: in send
timeout=timeout
.tox\py27\lib\site-packages\requests\packages\urllib3\connectionpool.py:559: in urlopen
body=body, headers=headers)
.tox\py27\lib\site-packages\requests\packages\urllib3\connectionpool.py:353: in _make_request
conn.request(method, url, **httplib_request_kw)
c:\python27\Lib\httplib.py:1053: in request
self._send_request(method, url, body, headers)
c:\python27\Lib\httplib.py:1093: in _send_request
self.endheaders(body)
c:\python27\Lib\httplib.py:1049: in endheaders
self._send_output(message_body)
c:\python27\Lib\httplib.py:893: in _send_output
self.send(msg)
c:\python27\Lib\httplib.py:869: in send
self.sock.sendall(data)
.tox\py27\lib\site-packages\httpretty\core.py:418: in sendall
self.real_sendall(data)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <httpretty.core.socket object at 0x0419DA50>
data = 'GET / HTTP/1.1\r\nHost: someplace.com%5Cresource.txt\r\nUser-Agent: python-requests/2.9.1\r\nConnection: keep-alive\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\n\r\n'
args = (), kw = {}
def real_sendall(self, data, *args, **kw):
"""Sends data to the remote server. This method is called
when HTTPretty identifies that someone is trying to send
non-http data.
The received bytes are written in this socket's StringIO
buffer so that HTTPretty can return it accordingly when
necessary.
"""
if not self.truesock:
> raise UnmockedError()
E UnmockedError: No mocking was registered, and real connections are not allowed (httpretty.allow_net_connect = False).
.tox\py27\lib\site-packages\httpretty\core.py:347: UnmockedError
______________ TestTabularResource.test_iterator_with_local_data ______________
self = <tests.test_resource.TestTabularResource object at 0x04292B10>
csv_tmpfile = <open file '<fdopen>', mode 'w+b' at 0x04473230>
def test_iterator_with_local_data(self, csv_tmpfile):
csv_contents = (
'country,value\n'
'China,õ©¡Õø¢\n'
'Brazil,Brasil\n'
).encode('utf-8')
csv_tmpfile.write(csv_contents)
csv_tmpfile.flush()
resource = TabularResource({'path': csv_tmpfile.name})
> data = [row for row in resource.iter()]
tests\test_resource.py:443:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
datapackage\resource.py:283: in iter
parser_options=parser_options)
.tox\py27\lib\site-packages\tabulator\topen.py:111: in topen
table.open()
.tox\py27\lib\site-packages\tabulator\table.py:86: in open
self.__parser.open(self.__loader)
.tox\py27\lib\site-packages\tabulator\parsers\csv.py:32: in open
self.__chars = loader.load(mode='t')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tabulator.loaders.file.File object at 0x04292AF0>, mode = 't'
def load(self, mode):
# Prepare source
scheme = 'file://'
source = self.__source
if source.startswith(scheme):
source = source.replace(scheme, '', 1)
# Prepare bytes
> bytes = io.open(source, 'rb')
E IOError: [Errno 13] Permission denied: u'c:\\users\\jamie\\appdata\\local\\temp\\tmp821olr.csv'
.tox\py27\lib\site-packages\tabulator\loaders\file.py:35: IOError
______________________ TestTabularResource.test_load_url ______________________
args = (<tests.test_resource.TestTabularResource object at 0x04274B30>,)
kw = {}
@functools.wraps(test)
def wrapper(*args, **kw):
httpretty.reset()
httpretty.enable()
try:
> return test(*args, **kw)
.tox\py27\lib\site-packages\httpretty\core.py:1063:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tests.test_resource.TestTabularResource object at 0x04274B30>
@httpretty.activate
def test_load_url(self):
url = 'http://someplace/resource.json'
body = (
'['
'{"country": "China", "value": "õ©¡Õø¢"},'
'{"country": "Brazil", "value": "Brasil"}'
']'
)
httpretty.register_uri(httpretty.GET, url,
body=body, content_type='application/json')
resource_dict = {
'url': url,
}
resource = TabularResource(resource_dict)
assert len(resource.data) == 2
> assert resource.data[0] == {'country': 'China', 'value': 'õ©¡Õø¢'}
E assert {'country': '...ue': '\xe4\xb8\xad\xe5\u203a\xbd'} == {'country': 'C...'value': '\u4e2d\u56fd'}
E Omitting 1 identical items, use -v to show
E Differing items:
E {'value': '\xe4\xb8\xad\xe5\u203a\xbd'} != {'value': '\u4e2d\u56fd'}
E Use -v to get the full diff
tests\test_resource.py:384: AssertionError
_________________ TestInlineResourceFile.test_it_loads_a_file _________________
self = <tests.test_resource_file.TestInlineResourceFile object at 0x044BF390>
def test_it_loads_a_file(self):
resource_file = self._create_resource_file_with('foo_newline_bar.txt')
> assert resource_file.read() == b'foo\nbar\n'
E assert 'foo\r\nbar\r\n' == 'foo\nbar\n'
E - foo\r
E ? --
E + foo
E - bar\r
E ? --
E + bar
tests\test_resource_file.py:22: AssertionError
_____________________ TestInlineResourceFile.test_unicode _____________________
self = <tests.test_resource_file.TestInlineResourceFile object at 0x04013BF0>
def test_unicode(self):
resource_file = self._create_resource_file_with('unicode.txt')
> assert resource_file.read().decode('utf-8') == 'õ©çõ║ïÕ╝ÇÕñ┤ÚÜ¥\n'
E assert '\u4e07\u4e8b\u5f00\u5934\u96be\r\\n' == '\u4e07\u4e8b\u5f00\u5934\u96be\\n'
E \u4e07\u4e8b\u5f00\u5934\u96be
tests\test_resource_file.py:34: AssertionError
____________________ TestInlineResourceFile.test_iterator _____________________
self = <tests.test_resource_file.TestInlineResourceFile object at 0x03FE7E50>
def test_iterator(self):
resource_file = self._create_resource_file_with('foo_newline_bar.txt')
content = [row for row in resource_file]
> assert content == [b'foo\n', b'bar\n']
E assert ['foo\r\n', 'bar\r\n'] == ['foo\n', 'bar\n']
E At index 0 diff: 'foo\r\n' != 'foo\n'
E Use -v to get the full diff
tests\test_resource_file.py:39: AssertionError
_________________ TestLocalResourceFile.test_it_loads_a_file __________________
self = <tests.test_resource_file.TestLocalResourceFile object at 0x03FBC670>
def test_it_loads_a_file(self):
resource_file = self._create_resource_file_with('foo_newline_bar.txt')
> assert resource_file.read() == b'foo\nbar\n'
E assert 'foo\r\nbar\r\n' == 'foo\nbar\n'
E - foo\r
E ? --
E + foo
E - bar\r
E ? --
E + bar
tests\test_resource_file.py:22: AssertionError
_____________________ TestLocalResourceFile.test_unicode ______________________
self = <tests.test_resource_file.TestLocalResourceFile object at 0x04262F30>
def test_unicode(self):
resource_file = self._create_resource_file_with('unicode.txt')
> assert resource_file.read().decode('utf-8') == 'õ©çõ║ïÕ╝ÇÕñ┤ÚÜ¥\n'
E assert '\u4e07\u4e8b\u5f00\u5934\u96be\r\\n' == '\u4e07\u4e8b\u5f00\u5934\u96be\\n'
E \u4e07\u4e8b\u5f00\u5934\u96be
tests\test_resource_file.py:34: AssertionError
_____________________ TestLocalResourceFile.test_iterator _____________________
self = <tests.test_resource_file.TestLocalResourceFile object at 0x0419DE10>
def test_iterator(self):
resource_file = self._create_resource_file_with('foo_newline_bar.txt')
content = [row for row in resource_file]
> assert content == [b'foo\n', b'bar\n']
E assert ['foo\r\n', 'bar\r\n'] == ['foo\n', 'bar\n']
E At index 0 diff: 'foo\r\n' != 'foo\n'
E Use -v to get the full diff
tests\test_resource_file.py:39: AssertionError
_________________ TestRemoteResourceFile.test_it_loads_a_file _________________
self = <tests.test_resource_file.TestRemoteResourceFile object at 0x03FBC750>
def test_it_loads_a_file(self):
resource_file = self._create_resource_file_with('foo_newline_bar.txt')
> assert resource_file.read() == b'foo\nbar\n'
E assert 'foo\r\nbar\r\n' == 'foo\nbar\n'
E - foo\r
E ? --
E + foo
E - bar\r
E ? --
E + bar
tests\test_resource_file.py:22: AssertionError
_____________________ TestRemoteResourceFile.test_unicode _____________________
self = <tests.test_resource_file.TestRemoteResourceFile object at 0x03FBC1B0>
def test_unicode(self):
resource_file = self._create_resource_file_with('unicode.txt')
> assert resource_file.read().decode('utf-8') == 'õ©çõ║ïÕ╝ÇÕñ┤ÚÜ¥\n'
E assert '\u4e07\u4e8b\u5f00\u5934\u96be\r\\n' == '\u4e07\u4e8b\u5f00\u5934\u96be\\n'
E \u4e07\u4e8b\u5f00\u5934\u96be
tests\test_resource_file.py:34: AssertionError
____________________ TestRemoteResourceFile.test_iterator _____________________
self = <tests.test_resource_file.TestRemoteResourceFile object at 0x03F68A10>
def test_iterator(self):
resource_file = self._create_resource_file_with('foo_newline_bar.txt')
content = [row for row in resource_file]
> assert content == [b'foo\n', b'bar\n']
E assert ['foo\r\n', 'bar\r\n'] == ['foo\n', 'bar\n']
E At index 0 diff: 'foo\r\n' != 'foo\n'
E Use -v to get the full diff
tests\test_resource_file.py:39: AssertionError
=============== 30 failed, 153 passed, 6 error in 4.21 seconds ================
ERROR: InvocationError: 'C:\\git\\github\\datapackages\\datapackage-py\\.tox\\py27\\Scripts\\py.test.EXE --cov datapackage --cov-report term-missing --cov-config .coveragerc'
py33 create: C:\git\github\datapackages\datapackage-py\.tox\py33
ERROR: InterpreterNotFound: python3.3
py34 create: C:\git\github\datapackages\datapackage-py\.tox\py34
ERROR: InterpreterNotFound: python3.4
py35 create: C:\git\github\datapackages\datapackage-py\.tox\py35
ERROR: InterpreterNotFound: python3.5
___________________________________ summary ___________________________________
ERROR: py27: commands failed
SKIPPED: py33: InterpreterNotFound: python3.3
SKIPPED: py34: InterpreterNotFound: python3.4
SKIPPED: py35: InterpreterNotFound: python3.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment