-
Notifications
You must be signed in to change notification settings - Fork 6
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 #255 from hakonhagland/fix_run_docker
Fixed bug in the run docker container script
- Loading branch information
Showing
5 changed files
with
87 additions
and
7 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,5 +1,13 @@ | ||
from pathlib import Path | ||
|
||
class Directories(): | ||
parts = "parts" | ||
docker_files = "docker_files" | ||
|
||
class FileNames(): | ||
main_document = "main.fodt" | ||
|
||
class Paths: | ||
container_home = Path("/home/docker-user") | ||
docker_files = Path("docker_files") | ||
|
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,20 @@ | ||
from pathlib import Path | ||
from lodocker.helpers import Helpers | ||
|
||
def test_git_root_exists(tmp_path: Path): | ||
# Create a dummy git repository in the tmp_path directory | ||
git_dir = tmp_path / ".git" | ||
git_dir.mkdir() | ||
# Create a folders and a file: "docker/.venv/lib/python3.12/site-packages/lodocker/run_container.py" | ||
docker_dir = tmp_path / "docker/.venv/lib/python3.12/site-packages/lodocker" | ||
docker_dir.mkdir(parents=True) | ||
run_container = docker_dir / "run_container.py" | ||
run_container.touch() | ||
# Create a parts directory | ||
parts_dir = tmp_path / "parts" | ||
parts_dir.mkdir() | ||
# Create a main.fodt file | ||
main_fodt = parts_dir / "main.fodt" | ||
main_fodt.touch() | ||
found_root = Helpers.locate_git_root_from_file(str(run_container)) | ||
assert found_root == tmp_path |