Beispiel #1
0
 def test_process_files(self, MockDedupManager):
     os.system("rm %s/*" % settings.RECORD_FILES_DIR)
     factories.build_fake_files(num_files=2,
     records_per_file=10)
     instance = MockDedupManager.return_value
     deduper.process_files()
     self.assertEqual(instance.dedup.call_count, 20)
Beispiel #2
0
 def test_metrics(self):
     os.system("rm %s/*" % settings.RECORD_FILES_DIR)
     factories.build_fake_files()
     metrics = deduper.process_files()
     self.assertEqual(metrics['is_dup']['count'],
         metrics['false_negative']['count'] + metrics['true_positive']['count'])
     self.assertEqual(metrics['not_dup']['count'],
         metrics['false_positive']['count'] + metrics['true_negative']['count'])
Beispiel #3
0
 def test_write_files(self, mock_method):
     factories.build_fake_files(num_files=10)
     self.assertEqual(mock_method.call_count, 10)