def test_decode_types(self): self.assertEqual(Any.decode('obj'), Object) self.assertEqual(Any.decode('num'), Number) self.assertEqual(Any.decode('bool'), Boolean) self.assertEqual(Any.decode('str'), String) self.assertEqual(Any.decode('arr'), Array) self.assertEqual(Any.decode('nil'), Nil) self.assertEqual(Any.decode('any'), Any)
def test_types(self): assert type(u'') == String assert type('') == String assert not type('') == Object assert not type([]) == Object assert type([]) == Array assert type('') == Any assert Any.kind('') == String assert Any.decode('str') == String assert Any.kind({}) == Object assert Any.kind(None) == Nil
def test_types(self): self.assertEqual(type(u''), String) self.assertEqual(type(''), String) self.assertNotEqual(type(''), Object) self.assertNotEqual(type([]), Object) self.assertEqual(type([]), Array) self.assertEqual(type(''), Any) self.assertEqual(Any.kind(''), String) self.assertEqual(Any.decode('str'), String) self.assertEqual(Any.kind({}), Object) self.assertEqual(Any.kind(None), Nil)
def test_types(self): self.assertEqual(type(1), Number) self.assertEqual(type(1.0), Number) self.assertEqual(type(1+3j), Number) self.assertEqual(type(-34.54555), Number) self.assertEqual(type(99999999999999999), Number) self.assertEqual(type(u''), String) self.assertEqual(type(''), String) self.assertEqual(type({}), Object) self.assertEqual(type(set()), Array) self.assertEqual(type(frozenset()), Array) self.assertNotEqual(type(''), Object) self.assertNotEqual(type([]), Object) self.assertEqual(type([]), Array) self.assertEqual(type(''), Any) self.assertEqual(Any.kind(''), String) self.assertEqual(Any.decode('str'), String) self.assertEqual(Any.kind({}), Object) self.assertEqual(Any.kind(None), Nil)
def test_types(self): self.assertEqual(type(1), Number) self.assertEqual(type(1.0), Number) self.assertEqual(type(1 + 3j), Number) self.assertEqual(type(-34.54555), Number) self.assertEqual(type(99999999999999999), Number) self.assertEqual(type(u''), String) self.assertEqual(type(''), String) self.assertEqual(type({}), Object) self.assertEqual(type(set()), Array) self.assertEqual(type(frozenset()), Array) self.assertNotEqual(type(''), Object) self.assertNotEqual(type([]), Object) self.assertEqual(type([]), Array) self.assertEqual(type(''), Any) self.assertEqual(Any.kind(''), String) self.assertEqual(Any.decode('str'), String) self.assertEqual(Any.kind({}), Object) self.assertEqual(Any.kind(None), Nil)