Skip to content

Commit

Permalink
Merge pull request #51 from dave3d/FixVersion
Browse files Browse the repository at this point in the history
BUG: fixed pkg name for version
  • Loading branch information
dave3d committed Oct 16, 2023
2 parents 04b40ee + 922bb3c commit 20ac538
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion comment_spell_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
__version__ = "unknown"

try:
__version__ = version("CommentSpellCheck")
__version__ = version("comment_spell_check")
except PackageNotFoundError:
# package is not installed
pass
Expand Down
46 changes: 30 additions & 16 deletions tests/test_comment_spell_check.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import unittest
import subprocess
import os


class TestCommentSpellCheck(unittest.TestCase):
Expand All @@ -12,10 +11,8 @@ def setUpClass(self):
def tearDownClass(cls):
print("\nTearing down comment_spell_check tests")

def test_comment_spell_check(self):
print("\nCommand_spell_check simple test")
cwd = os.getcwd()
print(cwd)
def test_basic(self):
print("\nCommand_spell_check: Basic Test")
runresult = subprocess.run(
[
"python",
Expand All @@ -26,15 +23,16 @@ def test_comment_spell_check(self):
"--prefix",
"myprefix",
"tests/example.h",
]
],
stdout=subprocess.PIPE,
)
print("Return code:", runresult.returncode)
if runresult.returncode:
self.fail("Simple test: comment_spell_check.py process returned bad code")
self.fail("\nBasic Test: FAIL")
output_string = str(runresult.stdout)
print("\nTest output:", output_string)

print("\nComment_spell_check test on itself")
cwd = os.getcwd()
print(cwd)
def test_codebase(self):
print("\nComment_spell_check: Code Base Test")
runresult = subprocess.run(
[
"python",
Expand All @@ -47,10 +45,26 @@ def test_comment_spell_check(self):
"--suffix",
".md",
".",
]
],
stdout=subprocess.PIPE,
)
print("Return code:", runresult.returncode)
if runresult.returncode:
self.fail(
"Self code test: comment_spell_check.py process returned bad code"
)
self.fail("\nCode Base Test: FAIL")
output_string = str(runresult.stdout)
print("\nTest output:", output_string)

def test_version(self):
print("\nComment_spell_check: Version Test")
runresult = subprocess.run(
[
"python",
"comment_spell_check.py",
"--version",
],
stdout=subprocess.PIPE,
)
version_string = str(runresult.stdout)
if runresult.returncode:
self.fail("Version Test: FAIL")
if "unknown" in version_string:
self.fail("Version Test: version string contains 'unknown'")

0 comments on commit 20ac538

Please sign in to comment.