Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_int_of(self):
self.assertEqual(Int[DEFAULT_INT_BITS], Int.type_of(1))
self.assertEqual(Int[DEFAULT_INT_BITS], Int.type_of(1000000000))
self.assertEqual(Int[DEFAULT_INT_BITS], Int.type_of(-1000000000))
self.assertEqual(Int8, Int.type_of(numpy.int8))
self.assertEqual(Int16, Int.type_of(numpy.int16))
self.assertEqual(Int32, Int.type_of(numpy.int32))
self.assertEqual(Int64, Int.type_of(numpy.int64))
def test_raise_when_invalid_bits(self):
with self.assertRaises(TypeError):
Float[8]
with self.assertRaises(TypeError):
Int[128]
def test_initialize_with_type(self):
self.assertEqual((Any, ...), NDArray[int].shape)
self.assertEqual(Int[DEFAULT_INT_BITS], NDArray[int]._type)
def test_get_type_int(self):
self.assertEqual(Int[DEFAULT_INT_BITS], get_type(42))