Ejemplo n.º 1
0
def test_delete_success(test_client, init_database):
    schedules = service.get_all(None)
    assert len(schedules) == 4

    service.delete(1)
    
    schedules = service.get_all(None)
    assert len(schedules) == 3
    assert schedules[0].id == 2
Ejemplo n.º 2
0
def test_get_all_with_params_date(test_client, init_database):
    filters = {
        'initial_date': datetime(2018, 9, 1, 10, 0),
        'final_date': datetime(2018, 9, 1, 12, 0)
    }
    schedules = service.get_all(filters)
    assert len(schedules) == 1
Ejemplo n.º 3
0
 def get(self):
     params = get_parser.parse_args()
     filters = {
         'initial_date': params.initial_date,
         'final_date': params.final_date,
         'meetingroomid': params.meetingroomid
     }
     return scheduling_service.get_all(filters)
Ejemplo n.º 4
0
def test_get_all_without_parameters(test_client, init_database):
    schedules = service.get_all(None)
    assert len(schedules) == 3
Ejemplo n.º 5
0
def test_create_scheduling_sucess():
    service.create('Title', datetime(2018, 9, 1, 10, 0), datetime(2018, 9, 1, 11, 0), 2, 1)
    schedules = service.get_all(None)
    assert len(schedules) == 4