from subprocess import call, check_output

class TestGit:
    """ Test that the user has a modern version of git installed """
from subprocess import call, check_output

class TestGit:
    """ Test that the user has a modern version of git installed """
    
    def git_version(self):
        """ returns a tuple with execution of git --version """
        exit_code = call(["git", "--version"])
        output = check_output(["git", "--version"]).decode("utf-8").lstrip().rstrip()
        return (output, exit_code)
    
    def test_git_version(self):
        """ tests the output from git_version() """
        assert self.git_version()[1] == 0
        assert self.git_version()[0].index('git version') >= 0
Add tests for git installation
Add tests for git installation

  from subprocess import call, check_output
  
  class TestGit:
      """ Test that the user has a modern version of git installed """
+     
+     def git_version(self):
+         """ returns a tuple with execution of git --version """
+         exit_code = call(["git", "--version"])
+         output = check_output(["git", "--version"]).decode("utf-8").lstrip().rstrip()
+         return (output, exit_code)
+     
+     def test_git_version(self):
+         """ tests the output from git_version() """
+         assert self.git_version()[1] == 0
+         assert self.git_version()[0].index('git version') >= 0
Add tests for git installation
## Code Before:
from subprocess import call, check_output

class TestGit:
    """ Test that the user has a modern version of git installed """
## Instruction:
Add tests for git installation
## Code After:
from subprocess import call, check_output

class TestGit:
    """ Test that the user has a modern version of git installed """
    
    def git_version(self):
        """ returns a tuple with execution of git --version """
        exit_code = call(["git", "--version"])
        output = check_output(["git", "--version"]).decode("utf-8").lstrip().rstrip()
        return (output, exit_code)
    
    def test_git_version(self):
        """ tests the output from git_version() """
        assert self.git_version()[1] == 0
        assert self.git_version()[0].index('git version') >= 0