def test_update_batch(): state = InventoryStateMachine() v1 = state.new_anonymous_batch(batch=Batch(associated_codes=[], id='BAT000000', owned_codes=[], props=None, sku_id=None)) state.update_batch(batch_id=v1, patch={'owned_codes': []}) state.get_existing_batch(batch_id=v1) state.teardown()
def test_update_batch_existing_sku(): state = InventoryStateMachine() v1 = state.new_sku(sku=Sku( associated_codes=[], id='SKU000000', name='', owned_codes=[], props={})) data = dst.DataProxy( Batch(associated_codes=[], id='BAT000000', name='', owned_codes=[], props={}, sku_id='SKU000000')) v2 = state.new_batch_existing_sku(data=data, sku_id=v1) state.update_batch(batch_id=v2, patch={}) state.teardown()