@pytest.mark.timeout(10)
def test_refspec(tmpdir):
    tmpdir = str(tmpdir)

    abs_source = os.path.join(tmpdir, 'deploy~git')
    with open(abs_source, 'w') as gfile:
        gfile.write(get_git_file('https://github.com/cxxr/test-git-repo.git',
            '@version', None, '--depth=3 --origin=github'))

    dest = os.path.join(tmpdir, 'dest-dir')

    finalfile = ext_git(abs_source, dest, {'version':'a057eb0faaa8'}, get_loader(), {})

    assert os.path.exists(finalfile)
    assert os.path.exists(os.path.join(finalfile, '.git'))

    # make sure that --origin=github was applied
    with open(os.path.join(finalfile, '.git', 'config')) as cfile:
        assert cfile.read() in 'remote "github"'

    install_file = os.path.join(finalfile, 'install')
    assert os.path.exists(install_file)

    with open(install_file) as ifile:
        assert ifile.read().strip() == 'echo "Success"'
dataset/ETHPy150Open gosquadron/squadron/tests/exthandlers/test_git.py/test_refspec/swapped operands of `in`