| 4 | |
| 5 | |
| 6 | class TestContribute(unittest.TestCase): |
| 7 | |
| 8 | def test_arguments(self): |
| 9 | args = contribute.arguments(['-nw']) |
| 10 | self.assertTrue(args.no_weekends) |
| 11 | self.assertEqual(args.max_commits, 10) |
| 12 | self.assertTrue(1 <= contribute.contributions_per_day(args) <= 20) |
| 13 | |
| 14 | def test_contributions_per_day(self): |
| 15 | args = contribute.arguments(['-nw']) |
| 16 | self.assertTrue(1 <= contribute.contributions_per_day(args) <= 20) |
| 17 | |
| 18 | def test_commits(self): |
| 19 | contribute.NUM = 11 # limiting the number only for unittesting |
| 20 | contribute.main(['-nw', |
| 21 | '--user_name=sampleusername', |
| 22 | '--user_email=your-username@users.noreply.github.com', |
| 23 | '-mc=12', |
| 24 | '-fr=82', |
| 25 | '-db=10', |
| 26 | '-da=15']) |
| 27 | self.assertTrue(1 <= int(check_output( |
| 28 | ['git', |
| 29 | 'rev-list', |
| 30 | '--count', |
| 31 | 'HEAD'] |
| 32 | ).decode('utf-8')) <= 20*(10 + 15)) |
nothing calls this directly
no outgoing calls
no test coverage detected