def test_half_take(monkeypatch): def half_take(self, amount): amount = int(amount/2) if amount > self.num_people: amount = self.num_people self.num_people -= amount return amount monkeypatch.setattr(Line, 'take', half_take) line = Line(10) res = line.take(5) assert res == 2
def test_lift_one_bench(line): line = Line(5) lift = Lift #line = Line(5) #lift = Lift(10, Quad) res = quad10.one_bench(line5) assert res == {'loaded': 4, 'num_benches': 1, 'unloaded': 0}
def line5(): line = Line(5) return line
def line_n(request): size = request.node.get_marker('line_size').args[0] line = Line(size) return line
def test_line_sizes(line_size, take_count, num_peopl): line = Line(0) res = line.take(5) assert line.num_people == 0
def test_line_bad(num_people): line = Line(num_people) with pytest.raises(TypeError): line.take(1)
def test_lift_one_bench(): line = Line(5) lift = Lift(10, Quad) res = lift.one_bench(line) assert res ==E {'loaded': 4, 'num_benches': 1, 'unloaded': 0}
def test_lift_one_bench(): line = Line(5) lift = Lift(10, Quad) res = quad.one_bench(line5) assert res == {}
def test_line_take(): line = Line(5) res = line.take(4) assert res == 5 assert line.num_people == 0
def test_line_sizes(): line = Line()
def test_line_bad(): line= Line([]) with pytest
def test_line_bad(): line= Line(10)
def test_line_sizes(): line = Line(0) res = line.take(5) assert
def line(): return Line(5)
def test_line_sizes(line_size, take_count, num_people): line = Line(line_size) res = line.take(take_count) assert line.num_people == num_people
def test_line_bad(): line= Line([]) with pytest.raises(T)
def test_line_bad(): line= Line([]) assert
def test_line_sizes(): line = Line(0) res = line.take(5) assert line.num_people == 0
def test_lift_one_bench(): line = Line(5) res = line.take(line)
def test_line_bad(): line = Line(10) with pytest.raises(TypeError): res = line.take(1)
def test_line_bad(size): line= Line()
def test_line_bad(): line = Line(10) assert line.num_people == 0
def test_line_bad(): line = Line([]) res = line.take(1)