Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import url: test: migrate to dir helpers #3072

Merged
merged 4 commits into from
Jan 9, 2020

Conversation

pared
Copy link
Contributor

@pared pared commented Jan 6, 2020

  • ❗ Have you followed the guidelines in the Contributing to DVC list?

  • πŸ“– Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.

  • ❌ Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

src = repo_dir.DATA
def test_import_url_to_dir(dname, tmp_dir, dvc):
tmp_dir.gen({"data_dir": {"imported_file": "file content"}})
src = os.path.join("data_dir", "imported_file")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But src is not imported, dst is imported_file. This is confusing. Also, instead of filecmp please use read_text() == "something".

@pared pared requested a review from efiop January 7, 2020 08:56
Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!


dst = os.path.join(dname, os.path.basename(src))
dst = os.path.join(dname, "file")
Copy link
Contributor

@efiop efiop Jan 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment:

Suggested change
dst = os.path.join(dname, "file")
dst = tmp_dir / dname / "file"

and then you could

stage.outs[0] == dst 

and so on.

@pared pared requested a review from efiop January 8, 2020 09:41
tests/func/test_import_url.py Outdated Show resolved Hide resolved
tests/func/test_import_url.py Outdated Show resolved Hide resolved
pared and others added 2 commits January 8, 2020 22:20
tests/func/test_import_url.py Outdated Show resolved Hide resolved
@efiop
Copy link
Contributor

efiop commented Jan 9, 2020

For the record: tests failing due to unrelated changes.

@efiop efiop merged commit 238b4e8 into iterative:master Jan 9, 2020
@pared pared deleted the 2896_import_url branch March 24, 2020 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants