Ejemplo n.º 1
0
def branch_metrics(data, owner, repo, branch):
    """Get coverage metrics for a particular branch."""
    create = request.method == "PUT"
    project = yorm.find(Project, owner, repo, branch, create=create)
    if not project:
        raise exceptions.NotFound("No such project or branch.")

    return _handle_request(project, data)
Ejemplo n.º 2
0
def metrics(data, owner, repo):
    """Get coverage metrics for the default branch."""
    create = request.method == "PUT"
    project = yorm.find(Project, owner, repo, create=create)
    if not project:
        raise exceptions.NotFound("No such project.")

    return _handle_request(project, data)
Ejemplo n.º 3
0
 def read(self, key):
     return yorm.find(ConfigModel, self.root, key)
Ejemplo n.º 4
0
 def it_can_also_be_called_with_an_instance(instance):
     expect(yorm.find(instance, create=True)) == instance
Ejemplo n.º 5
0
 def delete(self, game):
     model = yorm.find(GameFileModel, game.key)
     if model:
         yorm.delete(model)
Ejemplo n.º 6
0
 def read(self, key):
     return yorm.find(GameFileModel, key)
Ejemplo n.º 7
0
 def it_can_also_be_called_with_an_instance(instance):
     expect(yorm.find(instance, create=True)) == instance
Ejemplo n.º 8
0
 def read(self, key):
     return yorm.find(ConfigModel, self.root, key)