Skip to content

Commit

Permalink
Fixed Code Loading Bug (#50)
Browse files Browse the repository at this point in the history
* Added an integration code test

* Fixed the code loading bug

* Incremented version
  • Loading branch information
jrg94 authored May 11, 2022
1 parent 34af67a commit 000ad8e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ newest changes first.
0.11.x
-------

* v0.11.2
* Fixed a bug where code could not be loaded because the repo was deleted

* v0.11.1
* Fixed an issue where local repo could cause stack overflow
* Added sections to the changelog
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

MAJOR = 0
MINOR = 11
PATCH = 1
PATCH = 2

name = "subete"
version = f"{MAJOR}.{MINOR}"
Expand Down
1 change: 0 additions & 1 deletion subete/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def __init__(self, source_dir: Optional[str] = None) -> None:
self._total_tests: int = sum(1 for _, x in self._languages.items() if x.has_testinfo())
self._load_git_data()
self._git_repo.close() # Closes the repo before cleaning up the temp dir
self._temp_dir.cleanup()

def __getitem__(self, language: str) -> LanguageCollection:
"""
Expand Down
5 changes: 5 additions & 0 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ def test_modified_not_none():
assert program.modified() is not None


def test_code():
program: subete.SampleProgram = TEST_REPO["Python"]["Hello World"]
assert program.code() == "print('Hello, World!')\n"


def test_project_has_test():
program: subete.SampleProgram = TEST_REPO["Google Apps Script"]["Hello World"]
assert program.project().has_testing()
Expand Down

0 comments on commit 000ad8e

Please sign in to comment.