コード例 #1
0
ファイル: test_gitutils.py プロジェクト: wjin33/moose
    def testGitLines(self):
        with open(__file__, 'r') as fid:
            lines = fid.readlines()

        n_with_blank = len(lines)
        n_no_blank = n_with_blank - len([l for l in lines if not l.strip()])

        counts = mooseutils.git_lines(__file__)
        self.assertIn('Andrew E. Slaughter', counts)
        self.assertTrue(counts['Andrew E. Slaughter'] > 0)
        self.assertEqual(n_no_blank, sum(list(counts.values())))

        counts = mooseutils.git_lines(__file__, blank=True)
        self.assertIn('Andrew E. Slaughter', counts)
        self.assertTrue(counts['Andrew E. Slaughter'] > 0)
        self.assertEqual(n_with_blank, sum(list(counts.values())))
コード例 #2
0
ファイル: authors.py プロジェクト: loganharbour/moose
def target(filename):
    """Helper for counting the lines, by author of the given filename"""
    return mooseutils.git_lines(filename)