code: def test_long_asunsignedlong(self):
      # Test PyLong_AsUnsignedLong() and PyLong_FromUnsignedLong()
      asunsignedlong = _testcapi.pylong_asunsignedlong
      from _testcapi import ULONG_MAX
  
      # round trip (object -> unsigned long -> object)
      for value in (ULONG_MAX, 0, 1, 1234):
          with self.subTest(value=value):
              self.assertEqual(asunsignedlong(value), value)
  
      self.assertEqual(asunsignedlong(IntSubclass(42)), 42)
      self.assertRaises(TypeError, asunsignedlong, Index(42))
      self.assertRaises(TypeError, asunsignedlong, MyIndexAndInt())
  
      self.assertRaises(OverflowError, asunsignedlong, -1)
      self.assertRaises(OverflowError, asunsignedlong, ULONG_MAX + 1)
      self.assertRaises(TypeError, asunsignedlong, 1.0)
      self.assertRaises(TypeError, asunsignedlong, b"2")
      self.assertRaises(TypeError, asunsignedlong, "3")
      self.assertRaises(SystemError, asunsignedlong, NULL)
  
imports: import unittest
  import sys
  from test.support import import_helper
label_desc: Use image node_id 12 for calling the LongTests obj's underlying member method code with example usage: obj.test_long_asunsignedlong() without return types