def test_restarts3(self):
        container_info = {'RestartCount': 3}

        with patch('check_docker.get_state', return_value={'Status': 'running'}):
            with patch('check_docker.get_container_info', return_value=container_info):
                check_docker.check_restarts(container='container', warn=1, crit=2)
                self.assertEqual(check_docker.rc, check_docker.CRITICAL_RC)
    def test_restarts3(self):
        container_info = {'RestartCount': 3}

        with patch('check_docker.get_status', return_value='running'):
            with patch('check_docker.get_container_info', return_value=container_info):
                check_docker.check_restarts(container='container', warn=1, crit=2)
                self.assertEqual(check_docker.rc, check_docker.CRITICAL_RC)
    def test_restarts2(self):
        container_info = {'RestartCount': 1}

        with patch('check_docker.get_status', return_value='running'):
            with patch('check_docker.get_container_info',
                       return_value=container_info):
                check_docker.check_restarts(container='container',
                                            warn=1,
                                            crit=2)
                self.assertEqual(check_docker.rc, check_docker.WARNING_RC)