-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to get authors, date/time created, and date/time modified…
… for articles (#65) * Add support to get authors, date/time created, and date/time modified for articles * Refactor common docs operations to separate function * Only count required files * Remove import/export stuff
- Loading branch information
Showing
8 changed files
with
538 additions
and
93 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 |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
long_description = fh.read() | ||
|
||
MAJOR = 0 | ||
MINOR = 16 | ||
MINOR = 17 | ||
PATCH = 0 | ||
|
||
name = "subete" | ||
|
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import tempfile | ||
from pathlib import Path | ||
|
||
import git | ||
import pytest | ||
|
||
import subete | ||
|
||
|
||
def test_bad_repo_total_projects(bad_test_repo): | ||
assert bad_test_repo.total_approved_projects() == 1 | ||
|
||
|
||
def test_bad_repo_languages(bad_test_repo): | ||
assert len(list(bad_test_repo)) == 1 | ||
|
||
|
||
def test_bad_repo_total_programs(bad_test_repo): | ||
assert bad_test_repo.total_programs() == 1 | ||
|
||
|
||
def test_bad_repo_total_tests(bad_test_repo): | ||
assert bad_test_repo.total_tests() == 0 | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def bad_test_repo(): | ||
with tempfile.TemporaryDirectory() as repo_dir, tempfile.TemporaryDirectory() as website_repo_dir: | ||
# Create repo | ||
repo: git.Repo = git.Repo.init(repo_dir) | ||
|
||
archive_dir = f"{repo_dir}/archive/f/foo" | ||
sample_program_file = f"{archive_dir}/whatever.foo" | ||
Path(archive_dir).mkdir(parents=True) | ||
Path(sample_program_file).write_text("hello\n") | ||
|
||
repo.index.add([sample_program_file]) | ||
repo.index.commit("Initial commit") | ||
|
||
# Create website repo | ||
website_repo: git.Repo = git.Repo.init(website_repo_dir) | ||
|
||
project_doc_dir = f"{website_repo_dir}/sources/projects/bad" | ||
project_doc_file = f"{project_doc_dir}/something.md" | ||
Path(project_doc_dir).mkdir(parents=True) | ||
Path(project_doc_file).write_text("hello\n") | ||
|
||
website_repo.index.add([project_doc_file]) | ||
website_repo.index.commit("Initial commit") | ||
|
||
yield subete.load(repo_dir, website_repo_dir) | ||
|
||
repo.close() | ||
website_repo.close() |
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