-
-
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.
Update branch.repo refewrences (#284)
- Loading branch information
1 parent
c13552f
commit a4a71b6
Showing
14 changed files
with
364 additions
and
262 deletions.
There are no files selected for viewing
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
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
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,35 @@ | ||
from unittest.mock import MagicMock | ||
|
||
import pytest | ||
|
||
from cloudbot.config import Config | ||
|
||
|
||
def test_config_load_no_file(tmp_path, capsys): | ||
bot = MagicMock() | ||
config_file = tmp_path / "config.json" | ||
with pytest.raises(SystemExit): | ||
Config(bot, filename=config_file) | ||
|
||
data = capsys.readouterr() | ||
assert data.out == ( | ||
"No config file found! Bot shutting down in five " | ||
"seconds.\n" | ||
"Copy 'config.default.json' to " | ||
"'config.json' for defaults.\n" | ||
"For help, " | ||
"see htps://github.com/TotallyNotRobots/CloudBot. " | ||
"Thank you for " | ||
"using CloudBot!\n" | ||
) | ||
|
||
|
||
def test_save(tmp_path): | ||
config_file = tmp_path / "config.json" | ||
config_file.write_text("{}") | ||
bot = MagicMock() | ||
cfg = Config(bot, filename=config_file) | ||
cfg["foo"] = "bar" | ||
cfg.save_config() | ||
|
||
assert config_file.read_text() == '{\n "foo": "bar"\n}' |
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
Oops, something went wrong.