generated from allenai/python-package-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10ace7c
commit 507d5c4
Showing
10 changed files
with
63 additions
and
30 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
Empty file.
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 @@ | ||
/home/michell/Workspace/mstuttgart/atty/tests/.config/alacritty/themes/t3.toml |
Empty file.
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
import os | ||
|
||
from atty.main import _create_symlink, _get_atty_symlink_path, _get_theme_file_names | ||
|
||
test_folder_dir = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
|
||
def test__get_atty_symlink_path(): | ||
config = ".config/alacritty/alacritty.toml" | ||
res = _get_atty_symlink_path(config) | ||
assert res == ".config/alacritty/color.toml" | ||
|
||
|
||
def test__get_theme_file_names(): | ||
themes_path = f"{test_folder_dir}/.config/alacritty/themes" | ||
themes_filename = _get_theme_file_names(themes_path) | ||
|
||
assert themes_filename == ["t1", "t2", "t3"] | ||
|
||
|
||
def test__create_symlink(): | ||
config_file = os.sep.join([test_folder_dir, ".config", "alacritty", "alacritty.toml"]) | ||
themes_path = os.sep.join([test_folder_dir, ".config", "alacritty", "themes"]) | ||
theme_selected = "t3" | ||
|
||
_create_symlink(config_file, themes_path, theme_selected) | ||
|
||
symlink_file = os.sep.join([test_folder_dir, ".config", "alacritty", "color.toml"]) | ||
assert os.path.exists(symlink_file) | ||
assert os.path.islink(symlink_file) |