def test_testing(self):

        # Run function
        base.run(testing.dataset, testing.prefix, testing.source, self.target)

        # Assert schemas
        source = json.load(io.open(testing.source, encoding='utf-8'))
        target = json.load(io.open(self.target, encoding='utf-8'))
        assert source == target

        # Assert data
        for source, target in zip(source['resources'], target['resources']):
            spath = os.path.join(os.path.dirname(testing.source), source['path'])
            tpath = os.path.join(os.path.dirname(self.target), target['path'])
            source = io.open(spath, encoding='utf-8').read()
            target = io.open(tpath, encoding='utf-8').read()
            assert source == target
Example #2
0
    def test_testing(self):

        # Run function
        base.run(testing.url, testing.prefix, testing.source, self.target,
                 'testing')

        # Assert schemas
        source = json.load(io.open(testing.source, encoding='utf-8'))
        target = json.load(io.open(self.target, encoding='utf-8'))
        assert source == target

        # Assert data
        for source, target in zip(source['resources'], target['resources']):
            spath = os.path.join(os.path.dirname(testing.source),
                                 source['path'])
            tpath = os.path.join(os.path.dirname(self.target), target['path'])
            source = io.open(spath, encoding='utf-8').read()
            target = io.open(tpath, encoding='utf-8').read()
            assert source == target
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals

import sys
from pprint import pprint

sys.path.insert(0, '.')
from examples.base import run


# Fixtures
dataset = 'datapackage'
prefix = 'imf_weo_%s_%s_' % (sys.version_info.major, sys.version_info.minor)
source = 'examples/packages/imf-weo/datapackage.json'
target = 'tmp/packages/imf-weo/datapackage.json'


# Execution
if __name__ == '__main__':
    run(dataset, prefix, source, target)
Example #4
0
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals

import sys
from pprint import pprint

sys.path.insert(0, '.')
from examples.base import run

# Fixtures
url = 'sqlite:///:memory:'
prefix = 'finance-vix_'
source = 'examples/packages/finance-vix/datapackage.json'
target = 'tmp/packages/finance-vix/datapackage.json'

# Execution
if __name__ == '__main__':
    run(url, prefix, source, target)