mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
Merge pull request #1946 from Suor/pbar-large-dir
dvc: add progress bar when hashing a large dir
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import configobj
|
||||
from mock import patch
|
||||
|
||||
from dvc.main import main
|
||||
from dvc.command.remote import CmdRemoteAdd
|
||||
@@ -169,3 +170,16 @@ class TestRemoteShouldHandleUppercaseRemoteName(TestDvc):
|
||||
|
||||
ret = main(["push", "-r", self.upper_case_remote_name])
|
||||
self.assertEqual(ret, 0)
|
||||
|
||||
|
||||
def test_large_dir_progress(repo_dir, dvc):
|
||||
from dvc.utils import LARGE_DIR_SIZE
|
||||
from dvc.progress import progress
|
||||
|
||||
# Create a "large dir"
|
||||
for i in range(LARGE_DIR_SIZE + 1):
|
||||
repo_dir.create(os.path.join("gen", "{}.txt".format(i)), str(i))
|
||||
|
||||
with patch.object(progress, "update_target") as update_target:
|
||||
dvc.add("gen")
|
||||
assert update_target.called
|
||||
|
||||
Reference in New Issue
Block a user