コード例 #1
0
 def test_should_i_run_custom_any(self):
     from core.Status import Status
     from core.TestType import TestType
     test_type = str(uuid.uuid4())
     tt = TestType(test_type)
     tt.add_run_type('default', 'ANY', {'field': 'Status._status', 'operator': 'EQUAL', 'value': 'UNKNOWN'})
     tt.save()
     test_id = str(uuid.uuid4())
     test_status1 = 'FAILURE'
     details = {'browser': random.choice(['Firefox', 'Chrome'])}
     status1 = Status(test_id, test_type, test_status1, details=details)
     status1.save_and_update()
     res = Status(test_id).should_i_run()
     assert res == False
     test_id2 = str(uuid.uuid4())
     test_status2 = 'SUCCESS'
     status2 = Status(test_id2, test_type, test_status2, details=details)
     status2.save_and_update()
     res = Status(test_id).should_i_run()
     assert res == False
     test_status3 = 'SUCCESS'
     status3 = Status(test_id, test_type, test_status3, details=details)
     status3.save_and_update()
     res = Status(test_id).should_i_run()
     assert res == False
     status4 = Status(str(uuid.uuid4()))
     status4.add_unknown_if_none_exist()
     res = status4.should_i_run()
     assert res == True
コード例 #2
0
ファイル: test.py プロジェクト: ab9-er/TestSheriff
def run_get(test_id, run_type):
    status = StatusCore(test_id=test_id)
    status.add_unknown_if_none_exist()
    run = status.should_i_run(run_type)
    if run is None:
        abort(404)
    return run
コード例 #3
0
 def test_add_unknown_if_none_exists(self):
     from core.Status import Status
     test_id = str(uuid.uuid4())
     status = Status(test_id)
     assert status.get() == None
     status.add_unknown_if_none_exist()
     status_saved = Status(test_id).get()
     assert status_saved._id != None
     assert status_saved._last == True
     assert status_saved._status == 'UNKNOWN'
コード例 #4
0
ファイル: test.py プロジェクト: ab9-er/TestSheriff
 def get(self, test_id):
     status = StatusCore(test_id=test_id)
     status.add_unknown_if_none_exist()
     result = status.purge()
     return jsonify(result='Success', purge=result)