def test_receive_batch(): state = InventoryStateMachine() v1 = state.new_anonymous_batch(batch=Batch(associated_codes=[], id='BAT000000', owned_codes=[], props=None, sku_id=None)) v2 = state.new_bin(bin=Bin(contents={}, id='BIN000000', props=None)) state.receive_batch(batch_id=v1, bin_id=v2, quantity=1) state.get_existing_bin(v2)
def test_delete_bin_with_batch(): state = InventoryStateMachine() # state.delete_missing_bin(bin_id='BIN000000') v1 = state.new_anonymous_batch(batch=Batch(associated_codes=[], id='BAT000000', owned_codes=[], props=None, sku_id=None)) v2 = state.new_bin(bin=Bin(contents={}, id='BIN000000', props=None)) state.receive_batch(batch_id=v1, bin_id=v2, quantity=1) state.delete_nonempty_bin_noforce(bin_id=v2) state.teardown()
def test_was_undefined_key_error_01(): state = InventoryStateMachine() v1 = state.new_bin(bin=Bin(contents={}, id='BIN000000', props={'_': None})) v2 = state.new_anonymous_batch(batch=Batch(associated_codes=[], id='BAT575165', name='A', owned_codes=[], props={'': None}, sku_id=None)) state.batch_locations(batch_id=v2) state.receive_batch(batch_id=v2, bin_id=v1, quantity=1) state.batch_locations(batch_id=v2) state.teardown()