(self)
| 182 | self.assertEqual(expected, actual.value, value) |
| 183 | |
| 184 | def testMakeHttpDatetimeAttribute(self): |
| 185 | for value, expected in [ |
| 186 | (None, None), |
| 187 | # https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1 |
| 188 | ( |
| 189 | "Mon, 11 Sep 2023 14:07:29 GMT", |
| 190 | datetime(2023, 9, 11, 14, 7, 29, tzinfo=timezone.utc), |
| 191 | ), |
| 192 | # obsolete formats: |
| 193 | ( |
| 194 | "Monday, 11-Sep-23 14:07:29 GMT", |
| 195 | datetime(2023, 9, 11, 14, 7, 29, tzinfo=timezone.utc), |
| 196 | ), |
| 197 | ( |
| 198 | "Mon Sep 11 14:07:29 2023", |
| 199 | datetime(2023, 9, 11, 14, 7, 29, tzinfo=timezone.utc), |
| 200 | ), |
| 201 | ]: |
| 202 | actual = gho.GithubObject._makeHttpDatetimeAttribute(value) |
| 203 | self.assertEqual(gho._ValuedAttribute, type(actual), value) |
| 204 | self.assertEqual(expected, actual.value, value) |
| 205 | |
| 206 | def testMakeHttpDatetimeAttributeBadValues(self): |
| 207 | for value in ["not a timestamp", 1234]: |
nothing calls this directly
no test coverage detected