MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / testMakeTimetsampAttributeBadValues

Method testMakeTimetsampAttributeBadValues

tests/GithubObject.py:235–244  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

233 self.assertEqual(datetime(2021, 1, 23, 12, 34, 56, tzinfo=timezone.utc), actual.value)
234
235 def testMakeTimetsampAttributeBadValues(self):
236 for value in ["1611405296", 1234.567]:
237 actual = gho.GithubObject._makeTimestampAttribute(value)
238
239 self.assertEqual(gho._BadAttribute, type(actual))
240 with self.assertRaises(Framework.github.BadAttributeException) as e:
241 value = actual.value
242 self.assertEqual(value, e.exception.actual_value)
243 self.assertEqual(int, e.exception.expected_type)
244 self.assertIsNone(e.exception.transformation_exception)
245
246
247class CompletableGithubObjectWithPaginatedProperty(Framework.TestCase):

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected