Beispiel #1
0
 def test_r0p5_keyname_comma(self):
     subsample.subsample(
         self.longfile, self.outfile, subsample_rate=0.5,
         key_column='name', seed=self.seed)
     result = self.outfile.getvalue()
     benchmark = 'name,age,weight\r\nian,1,11\r\nian,1b,11b\r\nchang,3,33'\
         '\r\nchang,3b,33b\r\n'
     self.assertEqual(result, benchmark)
Beispiel #2
0
 def test_r0p5_pipe(self):
     subsample.subsample(
         self.pipefile, self.outfile, subsample_rate=0.5, seed=self.seed)
     result = self.outfile.getvalue()
     benchmark = 'name|age|weight\r\nian|1|11\r\nchang|3|33\r\n'
     self.assertEqual(result, benchmark)
Beispiel #3
0
 def test_r0p5_comma(self):
     subsample.subsample(
         self.commafile, self.outfile, subsample_rate=0.5, seed=self.seed)
     result = self.outfile.getvalue()
     benchmark = 'name,age,weight\r\nian,1,11\r\nchang,3,33\r\n'
     self.assertEqual(result, benchmark)