Exemple #1
0
    def test_initialize(self):
        # Test that `initialize` sets the task total counter with the correct
        # value
        # First, check that the total counter doesn't exist.
        task_total = lambda: stats.get_counter(
            self.job_id, 'h', 'uhs:tasks', 't')
        self.assertIsNone(task_total())

        calc = UHSCalculator(self.job_ctxt)

        calc.initialize()

        # In this test file, there is only 1 realization and 1 site.
        # So, the expected total is 1.
        self.assertEqual(1, task_total())
Exemple #2
0
    def test_initialize(self):
        # Test that `initialize` sets the task total counter with the correct
        # value
        # First, check that the total counter doesn't exist.
        task_total = lambda: stats.get_counter(
            self.job_id, 'h', 'uhs:tasks', 't')
        self.assertIsNone(task_total())

        calc = UHSCalculator(self.job_ctxt)

        calc.initialize()

        # In this test file, there is only 1 realization and 1 site.
        # So, the expected total is 1.
        self.assertEqual(1, task_total())