Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
rev: example-branch
link:
scripts:
-
- name: gitman_3
type: git
repo: https://github.com/jacebrowning/gitman-demo
rev: 7bd138fe7359561a8c2ff9d195dff238794ccc04
link:
scripts:
-
"""
)
config.datafile.load()
expect(gitman.install(depth=1)) == True
expect(len(os.listdir(config.location))) == 3
def it_contains_only_the_sparse_paths(config):
expect(gitman.install(depth=1, force=True)) == True
dir_listing = os.listdir(os.path.join(config.location, "gitman_1"))
expect(dir_listing).contains('src')
expect(len(dir_listing) == 1)
def it_creates_missing_directories(config):
shell.rm(config.location)
expect(gitman.install('gitman_1', depth=1)) == True
expect(os.listdir(config.location)) == ['gitman_1']
def it_deletes_dependencies_when_they_exist(config):
gitman.install('gitman_1', depth=1)
expect(os.path.isdir(config.location)) == True
expect(gitman.uninstall(keep_location=True)) == True
path = os.path.join(config.location, 'gitman_1')
expect(os.path.exists(path)) == False
expect(os.path.exists(config.location)) == True
gitman.uninstall()
def script_failures_can_be_ignored(config_with_scripts):
expect(gitman.install(force=True)) == True
def it_deletes_the_log_file(config):
gitman.install('gitman_1', depth=1)
gitman.list()
expect(os.path.exists(config.log_path)) == True
gitman.uninstall(keep_location=True)
expect(os.path.exists(config.log_path)) == False
gitman.uninstall()
def it_should_create_links(config_with_link):
expect(gitman.install(depth=1)) == True
expect(os.listdir()).contains('my_link')
def it_detects_failures_in_scripts(config_with_scripts):
with pytest.raises(RuntimeError):
expect(gitman.install())
def it_deletes_the_log_file(config):
gitman.install('gitman_1', depth=1)
gitman.list()
expect(os.path.exists(config.log_path)) == True
gitman.uninstall()
expect(os.path.exists(config.log_path)) == False
def it_deletes_dependencies_when_they_exist(config):
gitman.install('gitman_1', depth=1)
expect(os.path.isdir(config.location)) == True
expect(gitman.uninstall()) == True
expect(os.path.exists(config.location)) == False