예제 #1
0
def test_cases_of_last_day():
    caseid = oatspsql.create_case(error='test',
                                  host='test',
                                  description='Test',
                                  status='new')
    cases = oatspsql.show_cases_of_last_day()
    deleted = oatspsql.delete_case(caseid)
    assert caseid is not None and len(cases) >= 1 and deleted is True
예제 #2
0
def test_take_case():
    caseid = oatspsql.create_case(error='test',
                                  host='test',
                                  description='Test',
                                  status='new')
    tech_id = oatspsql.take_case(case_id=caseid, technician='techy')
    deleted = oatspsql.delete_case(caseid)
    assert caseid is not None and tech_id is not None and deleted is True
예제 #3
0
def test_update_case():
    caseid = oatspsql.create_case(error='test',
                                  host='test',
                                  description='Test',
                                  status='new')
    updated = oatspsql.update_case(caseid, solution='New stuff')
    deleted = oatspsql.delete_case(caseid)
    assert updated is not None and caseid is not None and deleted is True
예제 #4
0
def test_create_and_delete_case():
    caseid = None
    caseid = oatspsql.create_case(error='test',
                                  host='test',
                                  description='Test',
                                  status='new')
    deleted = oatspsql.delete_case(caseid)
    assert deleted is True and caseid is not None
예제 #5
0
def test_open_cases():
    caseid = oatspsql.create_case(error='test',
                                  host='test',
                                  description='Test',
                                  status='new')
    cases = oatspsql.numb_open_cases()
    deleted = oatspsql.delete_case(caseid)
    assert caseid is not None and cases >= 1 and deleted is True
예제 #6
0
def test_get_solutions_as_string():
    caseid = oatspsql.create_case(error='test',
                                  host='test',
                                  description='Test',
                                  status='new')
    sol = []
    sol = oatspsql.get_solutions_as_string(caseid)
    print sol
    deleted = oatspsql.delete_case(caseid)
    assert sol is not None and caseid is not None and deleted is True