(self)
| 695 | utils.write_file(fp, fp) |
| 696 | |
| 697 | def test_status_performance(self): |
| 698 | def assert_status_performance(): |
| 699 | # The test fails if `gl status` takes more than 100 times |
| 700 | # the time `git status` took. |
| 701 | MAX_TOLERANCE = 100 |
| 702 | |
| 703 | t = time.time() |
| 704 | gl.status() |
| 705 | gl_t = time.time() - t |
| 706 | |
| 707 | t = time.time() |
| 708 | git.status() |
| 709 | git_t = time.time() - t |
| 710 | |
| 711 | self.assertTrue( |
| 712 | gl_t < git_t*MAX_TOLERANCE, |
| 713 | msg='gl_t {0}, git_t {1}'.format(gl_t, git_t)) |
| 714 | |
| 715 | # All files are untracked |
| 716 | assert_status_performance() |
| 717 | # Track all files, repeat |
| 718 | logging.info('Doing a massive git add, this might take a while') |
| 719 | git.add('.') |
| 720 | logging.info('Done') |
| 721 | assert_status_performance() |
| 722 | |
| 723 | def test_branch_switch_performance(self): |
| 724 | MAX_TOLERANCE = 100 |
nothing calls this directly
no outgoing calls
no test coverage detected