Example #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(_dm_sniffer(fh), (True, {'delimiter': '\t'}))
Example #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(_dm_sniffer(fh), (True, {'delimiter': '\t'}))
Example #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(_dm_sniffer(fh), (False, {}))
Example #4
0
 def test_match_csv(self):
     self.assertEqual(_dm_sniffer(self.dm_3x3_csv_fh),
                      (True, {'delimiter': ','}))
Example #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(_dm_sniffer(fh), (False, {}))
Example #6
0
 def test_match_csv(self):
     self.assertEqual(_dm_sniffer(self.dm_3x3_csv_fh), (True, {
         'delimiter': ','
     }))