Example #1
0
 def test_get_current_vcs_hash_no_git(self, monkeypatch):
     def fake_check_output(*args, **kwargs):
         raise OSError()
     monkeypatch.setattr(subprocess, 'check_output', fake_check_output)
     assert utils.get_current_vcs_hash() == ''
Example #2
0
 def test_get_current_vcs_hash_git_error(self, monkeypatch):
     def fake_check_output(*args, **kwargs):
         raise subprocess.CalledProcessError(0, '', '')
     monkeypatch.setattr(subprocess, 'check_output', fake_check_output)
     assert utils.get_current_vcs_hash() == ''
Example #3
0
 def test_get_current_vcs_hash(self, monkeypatch):
     def fake_check_output(*args, **kwargs):
         return b'thisisagithash'
     monkeypatch.setattr(subprocess, 'check_output', fake_check_output)
     assert utils.get_current_vcs_hash() == 'thisisagithash'