Ejemplo n.º 1
0
def test_recreate_bin():
    state = InventoryStateMachine()
    v1 = state.new_bin(bin=Bin(id='BIN000000', props=None))
    print(state)
    state.delete_empty_bin(bin_id=v1)
    state.new_bin(bin=Bin(id='BIN000000', props=None))
    state.teardown()
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
def test_delete_used_sku():
    state = InventoryStateMachine()
    v1 = state.new_bin(bin=Bin(contents={}, id='BIN000000', props=None))
    v2 = state.new_sku(sku=Sku(associated_codes=[],
                               id='SKU000000',
                               name='',
                               owned_codes=[],
                               props=None))
    state.receive_sku(bin_id=v1, quantity=1, sku_id=v2)
    state.attempt_delete_used_sku(sku_id=v2)
    state.teardown()
Ejemplo n.º 5
0
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()
Ejemplo n.º 6
0
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()
Ejemplo n.º 7
0
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)
Ejemplo n.º 8
0
def test_bin():
    state = InventoryStateMachine()
    v1 = state.new_bin(bin=Bin(id='BIN000000', props=None))
    state.get_existing_bin(bin_id=v1)
    state.teardown()