-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from DataDog/local-target
Local target
- Loading branch information
Showing
7 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import os | ||
import unittest.mock | ||
|
||
import guarddog.cli | ||
|
||
|
||
def test_is_local_target(): | ||
assert guarddog.cli.is_local_target("/tmp/foo") | ||
assert guarddog.cli.is_local_target("./foo") | ||
assert not guarddog.cli.is_local_target("foo") | ||
|
||
with unittest.mock.patch('os.path.exists') as mock: | ||
mock.return_value = True | ||
assert guarddog.cli.is_local_target("foo.tar.gz") | ||
|
||
with unittest.mock.patch('os.path.exists') as mock: | ||
mock.return_value = False | ||
assert not guarddog.cli.is_local_target("foo.tar.gz") | ||
|