def setUp(self): BaseTestCase.setUp(self) when(miami.utils).now().thenReturn(datetime(2012, 11, 5, 9, 0, 0)) team = Team('Miami') team.members.append(User('Bob')) team.members.append(User.query.get(1)) task = Task('title1', 'detail', status='DONE', price=2, estimate=4, team=team, ready_time=datetime(2012, 11, 1, 10, 0, 0)) ts = TimeSlot(datetime(2012, 11, 1, 10, 0, 0), 3600, User.query.get(1)) task.time_slots.append(ts) self.create_entity(task) task = Task('title2', 'detai2', status='NEW', price=2, estimate=4, team=team, ready_time=datetime(2012, 11, 1, 10, 0, 0)) ts = TimeSlot(datetime(2012, 11, 2, 10, 0, 0), 3600, User.query.get(1), partner=User.query.get(2)) task.time_slots.append(ts) self.create_entity(task)
def setUp(self): BaseTestCase.setUp(self) when(miami.utils).now().thenReturn(datetime(2012, 11, 5, 9, 0, 0)) team = Team('Miami') team.members.append(User.query.get(1)) self.create_entity(team) burning = Burning(Team.query.get(1), miami.utils.get_current_monday()) burning.burning = 1 burning.remaining = 10 self.create_entity(burning) burning = Burning(Team.query.get(1), miami.utils.get_current_monday() + timedelta(days=1)) burning.burning = 2 burning.remaining = 8 self.create_entity(burning) task = Task('title1', 'detail', status='DONE', price=1, estimate=4, team=Team.query.get(1)) self.create_entity(task) task = Task('title1', 'detail', status='PROGRESS', price=1, estimate=4, team=Team.query.get(1)) self.create_entity(task) task = Task('title1', 'detail', status='READY', price=1, estimate=4, team=Team.query.get(1)) self.create_entity(task) task = Task('title1', 'detail', status='NEW', price=1, estimate=4, team=Team.query.get(1)) self.create_entity(task)
import schemathesis from tests import BaseTestCase app = BaseTestCase().create_app() schema = schemathesis.from_wsgi("/store/v1/openapi.yaml", app) schemathesis_config = dict(endpoint="/store/v1/items", method="POST") @schema.parametrize(**schemathesis_config) def test_no_server_errors(case): response = case.call_wsgi() assert response.status_code < 500