MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_tzinfo

Method test_tzinfo

test/test_bson.py:1287–1295  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1285 self.assertRaises(ValueError, CodecOptions, uuid_representation=2)
1286
1287 def test_tzinfo(self):
1288 self.assertRaises(TypeError, CodecOptions, tzinfo="pacific")
1289 tz = FixedOffset(42, "forty-two")
1290 self.assertRaises(ValueError, CodecOptions, tzinfo=tz)
1291 self.assertEqual(tz, CodecOptions(tz_aware=True, tzinfo=tz).tzinfo)
1292 self.assertEqual(repr(tz), "FixedOffset(datetime.timedelta(seconds=2520), 'forty-two')")
1293 self.assertEqual(
1294 repr(eval(repr(tz))), "FixedOffset(datetime.timedelta(seconds=2520), 'forty-two')"
1295 )
1296
1297 def test_codec_options_repr(self):
1298 r = (

Callers

nothing calls this directly

Calls 2

FixedOffsetClass · 0.90
CodecOptionsClass · 0.90

Tested by

no test coverage detected