-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add requirements file to the output folder (#280)
* Add feature codebase * Add integration tests * Improve tests * Add missing test Co-authored-by: Jeremy Wohlwend <33673620+jeremyasapp@users.noreply.github.com>
- Loading branch information
1 parent
150a4a2
commit 7b02dff
Showing
5 changed files
with
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import tempfile | ||
import mock | ||
|
||
|
||
from flambe.compile.utils import write_deps | ||
|
||
|
||
def test_write_deps(): | ||
dummy_dependencies = ['numpy==1.2.3', 'pip~=1.1.1', 'some_other-random dep'] | ||
with tempfile.NamedTemporaryFile() as tmpfile: | ||
write_deps(tmpfile.name, dummy_dependencies) | ||
|
||
assert tmpfile.read() == b'numpy==1.2.3\npip~=1.1.1\nsome_other-random dep' | ||
|
||
|
||
@mock.patch('flambe.compile.utils.get_frozen_deps') | ||
def test_write_deps_default(mock_deps): | ||
mock_deps.return_value = ['numpy==1.2.3', 'pip~=1.1.1', 'some_other-random dep'] | ||
with tempfile.NamedTemporaryFile() as tmpfile: | ||
write_deps(tmpfile.name) | ||
assert tmpfile.read() == b'numpy==1.2.3\npip~=1.1.1\nsome_other-random dep' | ||
mock_deps.assert_called_once() |