コード例 #1
0
    def do_run(self, args):
        from api_etl import Config

        self.config = Config()

        parts = args.split('.')
        services = []
        service_entries = []

        manifest_filename = "{}.yml".format(parts[0])
        manifest = Manifest(manifest_filename)

        if len(parts) == 1:
            services = svcs.service(parts[0])
            service_entries = manifest.get_services()
        else:
            services = [svcs.named_subservice(*parts)]
            service_entries = [manifest.get_service(parts[1])]

        # The ordering of entries in the manifest and entrypoints is
        # important, they must match otherwise this zip call will
        # pair up the wrong things.
        entry = zip(services, service_entries)
        for e in entry:
            ep, sm = e
            self.run_etl(parts[0], ep, sm)
コード例 #2
0
ファイル: etl.py プロジェクト: datagovuk/api_etl
    def do_run(self, args):
        from api_etl import Config

        self.config = Config()

        parts = args.split('.')
        services = []
        service_entries = []

        manifest_filename = "{}.yml".format(parts[0])
        manifest = Manifest(manifest_filename)

        if len(parts) == 1:
            services = svcs.service(parts[0])
            service_entries = manifest.get_services()
        else:
            services = [svcs.named_subservice(*parts)]
            service_entries = [manifest.get_service(parts[1])]

        # The ordering of entries in the manifest and entrypoints is
        # important, they must match otherwise this zip call will
        # pair up the wrong things.
        entry = zip(services, service_entries)
        for e in entry:
            ep, sm = e
            self.run_etl(parts[0], ep, sm)
コード例 #3
0
ファイル: test_services.py プロジェクト: datagovuk/api_etl
def test_get_subservice_fail_named():
    ep = svcs.named_subservice('health', 'tobermory')
コード例 #4
0
ファイル: test_services.py プロジェクト: datagovuk/api_etl
def test_get_subservice_fail_toplevel():
    ep = svcs.named_subservice('wombles', 'tobermory')
コード例 #5
0
ファイル: test_services.py プロジェクト: datagovuk/api_etl
def test_get_subservice():
    ep = svcs.named_subservice('health', 'hospitals')
    _check_hospital_entrypoints(ep)
コード例 #6
0
def test_get_subservice_fail_named():
    ep = svcs.named_subservice('health', 'tobermory')
コード例 #7
0
def test_get_subservice_fail_toplevel():
    ep = svcs.named_subservice('wombles', 'tobermory')
コード例 #8
0
def test_get_subservice():
    ep = svcs.named_subservice('health', 'hospitals')
    _check_hospital_entrypoints(ep)