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)
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'])