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'}))
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, {}))
def test_match_csv(self): self.assertEqual(_lsmat_sniffer(self.lsmat_3x3_csv_fh), (True, { 'delimiter': ',' }))
def test_match_csv(self): self.assertEqual(_lsmat_sniffer(self.lsmat_3x3_csv_fh), (True, {'delimiter': ','}))