-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test for install python dependencies from git and files (#100)
* test for install python dependencies from git and files * bump version * change log * update doc * Update docs/dependencies.md Co-Authored-By: Sean Shookman <[email protected]> * Update docs/dependencies.md Co-Authored-By: Sean Shookman <[email protected]>
- Loading branch information
1 parent
e4fcb79
commit 7e1bdee
Showing
6 changed files
with
77 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.7.3 | ||
1.7.4 |
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 |
---|---|---|
|
@@ -95,6 +95,49 @@ def test_buildDockerfile_base(self, mock_getcwd, mock_expanduser): | |
|
||
@mock.patch('os.path.expanduser') | ||
@mock.patch('os.getcwd') | ||
def test_buildDockerfile_base_py(self, mock_getcwd, mock_expanduser): | ||
folderPath = "{path}/test/files".format(path=self.path) | ||
filePath = "{folder}/Dockerfile".format(folder=folderPath) | ||
|
||
mock_expanduser.return_value = "{path}/test/plugins".format(path=self.path) | ||
mock_getcwd.return_value = folderPath | ||
config = sb.systems.generators.yaml.loadConfig() | ||
config.language = "Python" | ||
config.dependencies.append("github:github.com/repo") | ||
config.dependencies.append("file:libs/proj") | ||
config.dependencies.append("dtable=9.0") | ||
|
||
expectedDockerfile = """ | ||
# This Dockerfile was generated by Skelebot | ||
# Editing this file manually is not advised as all changes will be overwritten by Skelebot | ||
FROM skelebot/python-base | ||
MAINTAINER Mega Man <[email protected]> | ||
WORKDIR /app | ||
RUN ["pip", "install", "pyyaml"] | ||
RUN ["pip", "install", "artifactory"] | ||
RUN ["pip", "install", "argparse"] | ||
RUN ["pip", "install", "coverage"] | ||
RUN ["pip", "install", "pytest"] | ||
RUN ["pip", "install", "git+github.com/repo"] | ||
COPY libs/proj libs/proj | ||
RUN ["pip", "install", "/app/libs/proj"] | ||
RUN ["pip", "install", "dtable==9.0"] | ||
RUN rm -rf build/ | ||
RUN rm -rf dist/ | ||
COPY . /app | ||
CMD /bin/bash -c \"bash build.sh --env local --log info\"\n""" | ||
|
||
sb.systems.generators.dockerfile.buildDockerfile(config) | ||
|
||
data = None | ||
with open(filePath, "r") as file: | ||
data = file.read() | ||
self.assertTrue(data is not None) | ||
print(data) | ||
self.assertEqual(data, expectedDockerfile) | ||
@mock.patch('os.path.expanduser') | ||
@mock.patch('os.getcwd') | ||
def test_buildDockerfile_krb(self, mock_getcwd, mock_expanduser): | ||
folderPath = "{path}/test/files".format(path=self.path) | ||
filePath = "{folder}/Dockerfile".format(folder=folderPath) | ||
|
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