예제 #1
0
def test_py_file_renamed(tmpdir, repo):
  new_python_filename = "newfile.py"
  tmpdir.join(new_python_filename).write(tmpdir.join(python_filename).read())
  repo.index.remove([python_filename])
  repo.index.add([new_python_filename])
  repo.index.commit("rename a python file")

  assert [f[0] for f in git_iterator(None, Options())] == [new_python_filename]
예제 #2
0
def test_py_file_added(tmpdir, repo):
  repo.head.reference.commit
  new_python_filename = "newfile.py"
  tmpdir.join(new_python_filename).write('some python to check')
  repo.index.add([new_python_filename])
  repo.index.commit("add a python file")

  assert [f[0] for f in git_iterator(None, Options())] == [new_python_filename]
예제 #3
0
def test_py_file_renamed(tmpdir, repo):
    new_python_filename = "newfile.py"
    tmpdir.join(new_python_filename).write(tmpdir.join(python_filename).read())
    repo.index.remove([python_filename])
    repo.index.add([new_python_filename])
    repo.index.commit("rename a python file")

    assert [f[0]
            for f in git_iterator(None, Options())] == [new_python_filename]
예제 #4
0
def test_py_changed_in_branch(tmpdir, repo):
  # Create a commit in other branch and diff against it
  repo.heads.other_branch.checkout()
  tmpdir.join(python_filename).write('some more')
  repo.index.add([python_filename])
  repo.index.commit("modify a python file in another branch")
  repo.heads.feature_branch.checkout()

  assert [f[0] for f in git_iterator(None, Options(other_branch))] == [python_filename]
예제 #5
0
def test_py_file_added(tmpdir, repo):
    repo.head.reference.commit
    new_python_filename = "newfile.py"
    tmpdir.join(new_python_filename).write('some python to check')
    repo.index.add([new_python_filename])
    repo.index.commit("add a python file")

    assert [f[0]
            for f in git_iterator(None, Options())] == [new_python_filename]
예제 #6
0
def test_py_changed_in_branch(tmpdir, repo):
    # Create a commit in other branch and diff against it
    repo.heads.other_branch.checkout()
    tmpdir.join(python_filename).write('some more')
    repo.index.add([python_filename])
    repo.index.commit("modify a python file in another branch")
    repo.heads.feature_branch.checkout()

    assert [f[0] for f in git_iterator(None, Options(other_branch))
            ] == [python_filename]
예제 #7
0
def test_py_file_changed(tmpdir, repo):
  # First create a commit on master. Since we diff against the merge-base to master
  # by default, it shouldn't be in the diff.
  repo.heads.master.checkout()
  python_filename_on_master = 'some-python-file.py'
  tmpdir.join('some-python-file.py').write('some python in master')
  repo.index.add([python_filename_on_master])
  repo.index.commit("commit on master")

  repo.heads.feature_branch.checkout()
  tmpdir.join(python_filename).write('some python to check')
  repo.index.add([python_filename])
  repo.index.commit("modify a python file")

  assert [f[0] for f in git_iterator(None, Options())] == [tmpdir.join(python_filename).strpath]
def test_py_file_changed(tmpdir, repo):
    # First create a commit on master. Since we diff against the merge-base to master
    # by default, it shouldn't be in the diff.
    repo.heads.master.checkout()
    python_filename_on_master = 'some-python-file.py'
    tmpdir.join('some-python-file.py').write('some python in master')
    repo.index.add([python_filename_on_master])
    repo.index.commit("commit on master")

    repo.heads.feature_branch.checkout()
    tmpdir.join(python_filename).write('some python to check')
    repo.index.add([python_filename])
    repo.index.commit("modify a python file")

    assert [f[0] for f in git_iterator(None, Options())
            ] == [tmpdir.join(python_filename).strpath]
예제 #9
0
def test_py_file_changed(tmpdir, repo):
  tmpdir.join(python_filename).write('some python to check')
  repo.index.add([python_filename])
  repo.index.commit("modify a python file")

  assert [f[0] for f in git_iterator(None, Options())] == [python_filename]
예제 #10
0
def test_no_py_file_changed(tmpdir, repo):
  tmpdir.join(non_python_filename).write('some more')
  repo.index.add([non_python_filename])
  repo.index.commit("modify a non-python file")

  assert [f[0] for f in git_iterator(None, Options())] == []
예제 #11
0
def test_py_file_changed(tmpdir, repo):
    tmpdir.join(python_filename).write('some python to check')
    repo.index.add([python_filename])
    repo.index.commit("modify a python file")

    assert [f[0] for f in git_iterator(None, Options())] == [python_filename]
예제 #12
0
def test_no_py_file_changed(tmpdir, repo):
    tmpdir.join(non_python_filename).write('some more')
    repo.index.add([non_python_filename])
    repo.index.commit("modify a non-python file")

    assert [f[0] for f in git_iterator(None, Options())] == []