def test_parses_complexity_row(self): fake_module = 'other/file/there.py' fake_complexity_metric = 53 fake_freq_metric = 34 merger = merge_comp_freqs.Merged() a_row = ['Python', "./" + fake_module, 0, 1, fake_complexity_metric] merge_comp_freqs.parse_complexity(merger, a_row) b_row = [fake_module, fake_freq_metric] merge_comp_freqs.parse_freqs(merger, b_row) updated = merger.sorted_result() self.assertEqual(updated, [(fake_module, (fake_freq_metric, fake_complexity_metric))])
def test_starts_empty(self): m = merge_comp_freqs.Merged() self.assertEqual(m.sorted_result(), [])
def setUp(self): self._merger = merge_comp_freqs.Merged() self._simulate_existing(self.FAKED_MODULE, self.FAKED_COMLEXITY_METRIC)