(self, status: str)
| 242 | raise e |
| 243 | |
| 244 | def set_working_on(self, status: str) -> None: |
| 245 | self._check_session() |
| 246 | response = requests.put(f"https://scratch.mit.edu/site-api/classrooms/all/{self.id}/", |
| 247 | headers=self._headers, cookies=self._cookies, |
| 248 | json={"status": status}) |
| 249 | |
| 250 | try: |
| 251 | data = response.json() |
| 252 | if data["status"] == status: |
| 253 | # Success! |
| 254 | return |
| 255 | else: |
| 256 | warnings.warn(f"{self._session} may not be authenticated to edit {self}") |
| 257 | |
| 258 | except Exception as e: |
| 259 | warnings.warn(f"{self._session} may not be authenticated to edit {self}") |
| 260 | raise e |
| 261 | |
| 262 | def set_title(self, title: str) -> None: |
| 263 | self._check_session() |
nothing calls this directly
no test coverage detected