def test_allocating_to_a_batch_reduces_the_available_quantity(): batch = Batch("batch-001", "SMALL-TABLE", qty=20, eta=date.today()) line = OrderLine("order-ref", "SMALL-TABLE", 2) batch.allocate(line) assert batch.available_quantity == 18
def test_allocating_to_a_batch_reduces_the_available_quantity(): # Arrange batch = Batch("batch-001", "SMALL-TABLE", qty=20, eta=date.today()) line = OrderLine('order-ref', "SMALL-TABLE", 2) # Act - take action batch.allocate(line) # Assert assert batch.available_quantity == 18
def test_allocating_to_a_batch_rquantity(): batch = Batch("batch-001", "SMALL-TABLE", quantity=20, manufacture_date=date.today()) line = OrderLine("order-ref", "SMALL-TABLE", 2) batch.allocate(line) assert batch.available_quantity == 18
def test_allocating_to_a_batch_reduces_the_available_quantity(): batch = Batch("1", "SMALL_TABLE", qty=20, eta=today) line = OrderLine("1", "SMALL_TABLE", 2) batch.allocate(line) assert batch.available_quantity == 18
def test_allocatint_to_a_batch_reduces_available_quantity(): batch = Batch("batch-001", "SMALL-TABLE", qty=20, eta=date.today()) line = OrderLine("order-ref", "SMALL-TABLE", 2) batch.allocate(line) print(batch._allocations)
def test_allocating_to_a_batch_reduces_the_available_quantity(self): batch = Batch('batch-001', 'SMALL-TABLE', qty=20, eta=date.today()) line = OrderLine('order-ref', "SMALL-TABLE", 2) batch.allocate(line) self.assertEqual(18, batch.available_quantity)
def test_can_twice_allocate_ng_purchase2(self): """オーダー番号が違っても商品が違うと受け付けない""" batch = Batch('batch-001', 'ELEGANT-LAMP', 20, eta=date.today()) batch.allocate(OrderLine('order-123', 'ELEGANT-LAMP', 2)) batch.allocate(OrderLine('order-1233', 'ELEGANT-LAMPP', 2)) self.assertEqual(18, batch.available_quantity)
def test_can_twice_allocate_ok_purchase(self): """オーダー番号が違えば2連続注文を受け付ける""" batch = Batch('batch-001', 'ELEGANT-LAMP', 20, eta=date.today()) batch.allocate(OrderLine('order-123', 'ELEGANT-LAMP', 2)) batch.allocate(OrderLine('order-1233', 'ELEGANT-LAMP', 2)) self.assertEqual(16, batch.available_quantity)