示例#1
0
 def test_match_tsv(self):
     # Sniffer should match all valid files, and will match some invalid
     # ones too because it doesn't exhaustively check the entire file.
     fhs = self.valid_fhs + [self.invalid_1_fh, self.invalid_3_fh,
                             self.invalid_4_fh]
     for fh in fhs:
         self.assertEqual(_lsmat_sniffer(fh), (True, {'delimiter': '\t'}))
示例#2
0
 def test_match_tsv(self):
     # Sniffer should match all valid files, and will match some invalid
     # ones too because it doesn't exhaustively check the entire file.
     fhs = self.valid_fhs + [self.invalid_1_fh, self.invalid_3_fh,
                             self.invalid_4_fh]
     for fh in fhs:
         self.assertEqual(_lsmat_sniffer(fh), (True, {'delimiter': '\t'}))
示例#3
0
 def test_no_match(self):
     for fh in (self.empty_fh, self.invalid_2_fh, self.invalid_5_fh,
                self.invalid_6_fh):
         self.assertEqual(_lsmat_sniffer(fh), (False, {}))
示例#4
0
 def test_match_csv(self):
     self.assertEqual(_lsmat_sniffer(self.lsmat_3x3_csv_fh),
                      (True, {
                          'delimiter': ','
                      }))
示例#5
0
 def test_no_match(self):
     for fh in (self.empty_fh, self.invalid_2_fh, self.invalid_5_fh,
                self.invalid_6_fh):
         self.assertEqual(_lsmat_sniffer(fh), (False, {}))
示例#6
0
 def test_match_csv(self):
     self.assertEqual(_lsmat_sniffer(self.lsmat_3x3_csv_fh),
                      (True, {'delimiter': ','}))