def test_more_seqs_than_available(self): """ Specifying more sequences than are in input records should return them all """ result = list(transform.head(self.sequences, 10000)) self.assertEqual(self.sequences, result)
def test_values(self): """ Try specifying some values. """ for h in xrange(len(self.sequences) + 1): result = list(transform.head(self.sequences, h)) self.assertEqual(h, len(result)) self.assertEqual(self.sequences[:h], result)
def test_minus_zero(self): """ Test that -0 returns all sequences """ result = list(transform.head(self.sequences, '-0')) self.assertEqual([s.id for s in self.sequences], [r.id for r in result]) self.assertEqual([str(s.seq) for s in self.sequences], [str(r.seq) for r in result])
def test_more_seqs_than_available(self): """ Specifying more sequences than are in input records should return them all """ result = list(transform.head(self.sequences, '10000')) self.assertEqual([s.id for s in self.sequences], [r.id for r in result]) self.assertEqual([str(s.seq) for s in self.sequences], [str(r.seq) for r in result])
def test_minus_values(self): """ Try specifying some minus values. """ for h in xrange(1, len(self.sequences) + 1): result = list(transform.head(self.sequences, str(-h))) self.assertEqual(h, len(self.sequences) - len(result)) self.assertEqual([s.id for s in self.sequences[:-h]], [r.id for r in result]) self.assertEqual([str(s.seq) for s in self.sequences[:-h]], [str(r.seq) for r in result])
def test_zero(self): result = list(transform.head(self.sequences, 0)) self.assertEqual([], result)
def test_zero(self): result = list(transform.head(self.sequences, '0')) self.assertEqual([], result)