Check if the token is valid
(self)
| 25 | self.api_base = 'https://api.github.com' |
| 26 | |
| 27 | def check_auth(self) -> dict: |
| 28 | """ |
| 29 | Check if the token is valid |
| 30 | """ |
| 31 | try: |
| 32 | response = self.session.get(f'{self.api_base}/user') |
| 33 | response.raise_for_status() |
| 34 | return {'status': 0, 'message': 'Authentication successful', 'user': response.json()} |
| 35 | except Exception as e: |
| 36 | return {'status': -1, 'message': f'Authentication failed: {str(e)}'} |
| 37 | |
| 38 | def create_pull_request(self, repo: str, title: str, body: str, head: str, base: str) -> dict: |
| 39 | """ |
no test coverage detected