def test_record_empty(self): r = Record(None, ()) self.assertEqual(r, ()) self.assertLess(r, (1,)) self.assertEqual(len(r), 0) self.assertFalse(r) self.assertNotIn('a', r) self.assertEqual(repr(r), '<Record>') self.assertEqual(str(r), '<Record>') with self.assertRaisesRegex(KeyError, 'aaa'): r['aaa'] self.assertEqual(dict(r.items()), {}) self.assertEqual(list(r.keys()), []) self.assertEqual(list(r.values()), [])
def test_record_values(self): r = Record(R_AB, (42, 43)) vv = r.values() self.assertEqual(tuple(vv), (42, 43)) self.assertTrue(repr(vv).startswith('<RecordIterator '))