Only subtract excluded files from repos that were counted
This commit is contained in:
1 parent
9f76bf6c41
commit
26a9207daa
3 files changed
+49
-21
No files matched your search
@@ -93,6 +93,27 @@ def test_first_run_writes_the_stats_into_the_profile_readme(gitea, monkeypatch,
|
||||
assert "README.md updated successfully." in capsys.readouterr().err
|
||||
|
||||
|
||||
def test_excluded_file_in_a_skipped_repo_does_not_lower_other_repos(gitea, monkeypatch):
|
||||
# website (which holds the excluded aframe.js) can't be read, so none of
|
||||
# its bytes were counted and none should be subtracted.
|
||||
serve_account(gitea, monkeypatch)
|
||||
gitea.add("GET", WEBSITE_LANGS, {"message": "token scope is limited"}, status=403)
|
||||
gitea.add("GET", SCRIPTS_LANGS, {"Python": 3000, "JavaScript": 1000})
|
||||
run_main(monkeypatch)
|
||||
# Total 4000 -> Python 75.0% (37 blocks), JavaScript 25.0% (12 blocks)
|
||||
assert pushed_readme(gitea) == (
|
||||
"# Hi there\n\n"
|
||||
"<!--LANG_STATS_START-->\n"
|
||||
"## 📊 Languages\n"
|
||||
+ "█" * 37
|
||||
+ " Python 75.0%\\\n"
|
||||
+ "█" * 12
|
||||
+ " JavaScript 25.0%\n"
|
||||
"<!--LANG_STATS_END-->\n\n"
|
||||
"Thanks for visiting\n"
|
||||
)
|
||||
|
||||
|
||||
def test_first_run_saves_repo_timestamps_without_the_profile_repo(
|
||||
gitea, monkeypatch, state_file
|
||||
):
|
||||
|
||||
Reference in new issue
Block a user