def test_move_sku(data): state = InventoryStateMachine() v1 = state.new_bin(bin=Bin(contents={}, id='BIN000000', props=None)) v2 = state.new_bin(bin=Bin(contents={}, id='BIN000001', props=None)) v3 = state.new_sku(sku=Sku(id='SKU000000')) state.receive_sku(bin_id=v1, sku_id=v3, quantity=1) state.move(data=data, destination_binId=v2, source_binId=v1) state.get_existing_bin(bin_id=v1) state.get_existing_bin(bin_id=v2) state.teardown()
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_update_bin(): state = InventoryStateMachine() v1 = state.new_bin(bin=Bin(id='BIN000000', props=None)) state.update_bin(bin_id=v1, newProps={"1": "New props"}) state.get_existing_bin(bin_id=v1)
def test_bin(): state = InventoryStateMachine() v1 = state.new_bin(bin=Bin(id='BIN000000', props=None)) state.get_existing_bin(bin_id=v1) state.teardown()