Ejemplo n.º 1
0
def test_handleRequestAverage02():
    print "test_handleRequestAverage02"
    fakeCursor = FakeCursor(databaseSelectResponsesTest2)
    fakeForm = FakeForm(fullStream02)
    exitCode = c.handleRequest(fakeForm, fakeCursor, c)
    assert fakeCursor.inTransaction == False
    assert exitCode == 500
Ejemplo n.º 2
0
def test_handleRequestValues03():
    print "test_handleRequestValues03"
    fakeCursor = FakeCursor(databaseSelectResponsesTest1)
    fakeForm = FakeForm(fullStream03)
    exitCode = c.handleRequest(fakeForm, fakeCursor, c)
    assert fakeCursor.inTransaction == False
    assert exitCode == None
Ejemplo n.º 3
0
def test_handleRequestAverage01():
    print "test_handleRequestAverage01"
    fakeCursor = FakeCursor(databaseSelectResponsesTest1)
    fakeForm = FakeForm(fullStream02)
    s = StringIO.StringIO()
    exitCode = c.handleRequest(fakeForm, fakeCursor, c, s)
    value = s.getvalue()
    assert value == """Content-type: text/plain\n\nRETURN\ttest_1\t2.00\tgraph.html#tests=[{"test":45,"branch":3455,"machine":234}]\n"""
    assert fakeCursor.inTransaction == False
    assert exitCode == None
Ejemplo n.º 4
0
def test_handleRequestValues01():
    print "test_handleRequestValues01"
    fakeCursor = FakeCursor(databaseSelectResponsesTest1)
    fakeForm = FakeForm(fullStream01)
    s = StringIO.StringIO()
    exitCode = c.handleRequest(fakeForm, fakeCursor, c, s)
    value = s.getvalue()
    assert value == """Content-type: text/plain\n\nRETURN\ttest_1\tgraph.html#type=series&tests=[{"test":45,"branch":3455,"machine":234,"testrun":6667}]\nRETURN\ttest_1\t2.00\tgraph.html#tests=[{"test":45,"branch":3455,"machine":234}]\n"""
    for testTuple, answerTuple in zip(fakeCursor.inserts["test_run_values"], valuesList1a):
        assert testTuple == answerTuple
    assert fakeCursor.inTransaction == False
    assert exitCode == None
Ejemplo n.º 5
0
def application(req):
    (responseText, errorCode) = collect.handleRequest(req, db, MySQLdb)
    return Response(
        responseText,
        content_type='text/plain',
        status=errorCode)
Ejemplo n.º 6
0
def application(req):
    (responseText, errorCode) = collect.handleRequest(req, db, MySQLdb)
    return Response(responseText, content_type='text/plain', status=errorCode)
Ejemplo n.º 7
0
def application(req):
    collect.handleRequest(req, db, MySQLdb)