Change ReadyToUse for Available

This commit is contained in:
Xavier Bustamante Talavera 2019-07-06 15:06:22 +02:00
parent 922a8c743a
commit f8ec8fc882
6 changed files with 10 additions and 10 deletions

View File

@ -104,7 +104,7 @@ class Dummy:
# Perform generic actions # Perform generic actions
for pc, model in zip(pcs, for pc, model in zip(pcs,
{m.ToRepair, m.Repair, m.ToPrepare, m.ReadyToUse, m.ToPrepare, {m.ToRepair, m.Repair, m.ToPrepare, m.Available, m.ToPrepare,
m.Prepare}): m.Prepare}):
user.post({'type': model.t, 'devices': [pc]}, res=m.Action) user.post({'type': model.t, 'devices': [pc]}, res=m.Action)
@ -144,7 +144,7 @@ class Dummy:
user.post({'type': m.ToPrepare.t, 'devices': [sample_pc]}, res=m.Action) user.post({'type': m.ToPrepare.t, 'devices': [sample_pc]}, res=m.Action)
user.post({'type': m.Prepare.t, 'devices': [sample_pc]}, res=m.Action) user.post({'type': m.Prepare.t, 'devices': [sample_pc]}, res=m.Action)
user.post({'type': m.ReadyToUse.t, 'devices': [sample_pc]}, res=m.Action) user.post({'type': m.Available.t, 'devices': [sample_pc]}, res=m.Action)
user.post({'type': m.Price.t, 'device': sample_pc, 'currency': 'EUR', 'price': 85}, user.post({'type': m.Price.t, 'device': sample_pc, 'currency': 'EUR', 'price': 85},
res=m.Action) res=m.Action)
# todo test reserve # todo test reserve

View File

@ -188,9 +188,9 @@ class RepairDef(ActionDef):
SCHEMA = schemas.Repair SCHEMA = schemas.Repair
class ReadyToUse(ActionDef): class Available(ActionDef):
VIEW = None VIEW = None
SCHEMA = schemas.ReadyToUse SCHEMA = schemas.Available
class ToPrepareDef(ActionDef): class ToPrepareDef(ActionDef):

View File

@ -1256,7 +1256,7 @@ class Repair(ActionWithMultipleDevices):
""" """
class ReadyToUse(ActionWithMultipleDevices): class Available(ActionWithMultipleDevices):
"""The device is ready to be used. """The device is ready to be used.
This involves greater preparation from the ``Prepare`` action, This involves greater preparation from the ``Prepare`` action,

View File

@ -347,8 +347,8 @@ class Repair(ActionWithMultipleDevices):
__doc__ = m.Repair.__doc__ __doc__ = m.Repair.__doc__
class ReadyToUse(ActionWithMultipleDevices): class Available(ActionWithMultipleDevices):
__doc__ = m.ReadyToUse.__doc__ __doc__ = m.Available.__doc__
class ToPrepare(ActionWithMultipleDevices): class ToPrepare(ActionWithMultipleDevices):

View File

@ -56,5 +56,5 @@ class Physical(State):
Repaired = e.Repair Repaired = e.Repair
Preparing = e.ToPrepare Preparing = e.ToPrepare
Prepared = e.Prepare Prepared = e.Prepare
ReadyToBeUsed = e.ReadyToUse ReadyToBeUsed = e.Available
InUse = e.Live InUse = e.Live

View File

@ -168,7 +168,7 @@ def test_update_components_action_multiple():
hdd = HardDrive(serial_number='foo', manufacturer='bar', model='foo-bar') hdd = HardDrive(serial_number='foo', manufacturer='bar', model='foo-bar')
computer.components.add(hdd) computer.components.add(hdd)
ready = models.ReadyToUse() ready = models.Available()
assert not ready.devices assert not ready.devices
assert not ready.components assert not ready.components
@ -214,7 +214,7 @@ def test_update_parent():
(models.ToRepair, states.Physical.ToBeRepaired), (models.ToRepair, states.Physical.ToBeRepaired),
(models.Repair, states.Physical.Repaired), (models.Repair, states.Physical.Repaired),
(models.ToPrepare, states.Physical.Preparing), (models.ToPrepare, states.Physical.Preparing),
(models.ReadyToUse, states.Physical.ReadyToBeUsed), (models.Available, states.Physical.ReadyToBeUsed),
(models.Prepare, states.Physical.Prepared) (models.Prepare, states.Physical.Prepared)
])) ]))
def test_generic_action(action_model_state: Tuple[models.Action, states.Trading], def test_generic_action(action_model_state: Tuple[models.Action, states.Trading],