def test_get_job_status_no_jobs(self):

        change = {'jobs': []}

        complete, okay = dash.get_job_status(change)
        self.assertEqual(0, complete)
        self.assertEqual(None, okay)
    def test_get_job_status_no_jobs(self):

        change = {'jobs': []}

        complete, okay = dash.get_job_status(change)
        self.assertEqual(0, complete)
        self.assertEqual(None, okay)
    def test_get_job_status_okay(self):
        change = {'jobs':
                      [{'result': 'SUCCESS', 'voting': True},
                       {'result': None, 'voting': True},
                       {'result': 'FAILED', 'voting': False},
                       ]}

        complete, okay = dash.get_job_status(change)
        self.assertEqual(66, complete)
        self.assertEqual('yes', okay)
    def test_get_job_status_maybe(self):

        change = {'jobs':
                      [{'result': 'SUCCESS', 'voting': True},
                       {'result': None, 'voting': True},
                       {'result': 'ABORTED', 'voting': True},
                       ]}

        complete, okay = dash.get_job_status(change)
        self.assertEqual(66, complete)
        self.assertEqual('maybe', okay)
    def test_get_job_status_okay(self):
        change = {
            'jobs': [
                {
                    'result': 'SUCCESS',
                    'voting': True
                },
                {
                    'result': None,
                    'voting': True
                },
                {
                    'result': 'FAILED',
                    'voting': False
                },
            ]
        }

        complete, okay = dash.get_job_status(change)
        self.assertEqual(66, complete)
        self.assertEqual('yes', okay)
    def test_get_job_status_maybe(self):

        change = {
            'jobs': [
                {
                    'result': 'SUCCESS',
                    'voting': True
                },
                {
                    'result': None,
                    'voting': True
                },
                {
                    'result': 'ABORTED',
                    'voting': True
                },
            ]
        }

        complete, okay = dash.get_job_status(change)
        self.assertEqual(66, complete)
        self.assertEqual('maybe', okay)