Esempio n. 1
0
    def test_legends(self):
        done_state = SimulationStateStatus("Finished", None, None)
        done_state.count = 10
        done_state.total_count = 100
        monitor = Monitor(out=StringIO())

        legends = monitor._get_legends([done_state])

        self.assertEqual("Finished       10/100", legends[done_state])
Esempio n. 2
0
    def test_legends(self):
        monitor = Monitor(out=StringIO())
        sd = SnapshotDict(status="")
        for i in range(0, 100):
            status = REALIZATION_STATE_FINISHED if i < 10 else REALIZATION_STATE_RUNNING
            sd.reals[i] = Realization(status=status, active=True)
        monitor._snapshots[0] = Snapshot(sd.dict())
        legends = monitor._get_legends()

        self.assertEqual(
            """    Waiting         0/100
    Pending         0/100
    Running        90/100
    Failed          0/100
    Finished       10/100
    Unknown         0/100
""",
            legends,
        )