Refactor Class Name
This commit is contained in:
parent
455585f78c
commit
9dc32ac92f
1 changed files with 8 additions and 8 deletions
|
@ -21,7 +21,7 @@ from domain import ReleaseType, Release
|
||||||
from infrastructure import ReleaseTypeRepository, VersionRepository, ReleaseRepository
|
from infrastructure import ReleaseTypeRepository, VersionRepository, ReleaseRepository
|
||||||
from infrastructure_api import GitApi
|
from infrastructure_api import GitApi
|
||||||
|
|
||||||
class TestGitApi(GitApi):
|
class MyGitApi(GitApi):
|
||||||
def __init__(self, commit_string):
|
def __init__(self, commit_string):
|
||||||
self.commit_string = commit_string
|
self.commit_string = commit_string
|
||||||
|
|
||||||
|
@ -115,33 +115,33 @@ def test_release_repository(tmp_path):
|
||||||
f.write_text(contents)
|
f.write_text(contents)
|
||||||
|
|
||||||
# test
|
# test
|
||||||
sut = ReleaseRepository(VersionRepository(f), ReleaseTypeRepository(TestGitApi('MINOR test')), 'main')
|
sut = ReleaseRepository(VersionRepository(f), ReleaseTypeRepository(MyGitApi('MINOR test')), 'main')
|
||||||
release = sut.get_release()
|
release = sut.get_release()
|
||||||
|
|
||||||
assert release is not None
|
assert release is not None
|
||||||
|
|
||||||
|
|
||||||
def test_release_type_repository():
|
def test_release_type_repository():
|
||||||
sut = ReleaseTypeRepository(TestGitApi('MINOR test'))
|
sut = ReleaseTypeRepository(MyGitApi('MINOR test'))
|
||||||
release_type = sut.get_release_type()
|
release_type = sut.get_release_type()
|
||||||
assert release_type is ReleaseType.MINOR
|
assert release_type is ReleaseType.MINOR
|
||||||
|
|
||||||
sut = ReleaseTypeRepository(TestGitApi('MINOR bla'))
|
sut = ReleaseTypeRepository(MyGitApi('MINOR bla'))
|
||||||
release_type = sut.get_release_type()
|
release_type = sut.get_release_type()
|
||||||
assert release_type is ReleaseType.MINOR
|
assert release_type is ReleaseType.MINOR
|
||||||
|
|
||||||
sut = ReleaseTypeRepository(TestGitApi('Major bla'))
|
sut = ReleaseTypeRepository(MyGitApi('Major bla'))
|
||||||
release_type = sut.get_release_type()
|
release_type = sut.get_release_type()
|
||||||
assert release_type == ReleaseType.MAJOR
|
assert release_type == ReleaseType.MAJOR
|
||||||
|
|
||||||
sut = ReleaseTypeRepository(TestGitApi('PATCH bla'))
|
sut = ReleaseTypeRepository(MyGitApi('PATCH bla'))
|
||||||
release_type = sut.get_release_type()
|
release_type = sut.get_release_type()
|
||||||
assert release_type == ReleaseType.PATCH
|
assert release_type == ReleaseType.PATCH
|
||||||
|
|
||||||
sut = ReleaseTypeRepository(TestGitApi('SNAPSHOT bla'))
|
sut = ReleaseTypeRepository(MyGitApi('SNAPSHOT bla'))
|
||||||
release_type = sut.get_release_type()
|
release_type = sut.get_release_type()
|
||||||
assert release_type == ReleaseType.SNAPSHOT
|
assert release_type == ReleaseType.SNAPSHOT
|
||||||
|
|
||||||
sut = ReleaseTypeRepository(TestGitApi('bla'))
|
sut = ReleaseTypeRepository(MyGitApi('bla'))
|
||||||
release_type = sut.get_release_type()
|
release_type = sut.get_release_type()
|
||||||
assert release_type == None
|
assert release_type == None
|
||||||
|
|
Loading…
Reference in a new issue