Exemplo n.º 1
0
def getLoader(user, repo, sha=None, prov=None):
    """Build a fileLoader (LocalLoader or GithubLoader) for the given repository."""
    if user is None and repo is None:
        loader = LocalLoader()
    else:
        loader = GithubLoader(user, repo, sha, prov)
    return loader
Exemplo n.º 2
0
def getLoader(user, repo, subdir=None, spec_url=None, sha=None, prov=None):
    """Build a fileLoader (LocalLoader, GithubLoader, URLLoader) for the given parameters."""
    if user is None and repo is None and not spec_url:
        loader = LocalLoader()
    elif spec_url:
        loader = URLLoader(spec_url)
    else:
        loader = GithubLoader(user, repo, subdir, sha, prov)
    return loader
Exemplo n.º 3
0
def getLoader(user, repo, subdir=None, query_urls=[], sha=None, prov=None):
    """Build a fileLoader (LocalLoader, GithubLoader, ParamLoader) for the given parameters."""
    if user is None and repo is None and not query_urls:
        loader = LocalLoader()
    elif query_urls:
        loader = ParamLoader(query_urls)
    else:
        loader = GithubLoader(user, repo, subdir, sha, prov)
    return loader
Exemplo n.º 4
0
 def setUpClass(self):
     self.loader = LocalLoader('./tests/repo/')
     self.app = Flask('unittests')
Exemplo n.º 5
0
 def setUpClass(self):
     self.loader = LocalLoader('./tests/repo/')
Exemplo n.º 6
0
 def setUpClass(self):
     self.loader = LocalLoader(path.join('tests', 'repo'))
Exemplo n.º 7
0
                "value": "o4"
            }
        }, {
            "p": {
                "type": "string",
                "value": "p5"
            },
            "o": {
                "type": "string",
                "value": "o5"
            }
        }]
    }
}


def mock_process_sparql_query_text(query_text, raw_repo_uri, call_name,
                                   extraMetadata):
    mockItem = {"status": "This is a mock item", "call_name": call_name}
    return mockItem


filesInRepo = [{
    u'name': u'fakeFile1.rq',
    u'download_url': u'https://example.org/path/to/fakeFile.rq',
    u'decoded_content':
    'CONTENT ?'.encode()  # Because Github ContentFile object contains bytes.
}]

mockLoader = LocalLoader(base_url)