Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
modern.dev1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alma Berisha
modern.dev1
Commits
daa04da6
Commit
daa04da6
authored
2 months ago
by
Alma Berisha
Browse files
Options
Downloads
Patches
Plain Diff
test
parent
119c3dac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
GitHub Desktop.lnk
+0
-0
0 additions, 0 deletions
GitHub Desktop.lnk
import unittest.py
+50
-0
50 additions, 0 deletions
import unittest.py
modern-dev
+1
-0
1 addition, 0 deletions
modern-dev
test.py
+0
-1
0 additions, 1 deletion
test.py
with
51 additions
and
1 deletion
GitHub Desktop.lnk
0 → 100644
+
0
−
0
View file @
daa04da6
File added
This diff is collapsed.
Click to expand it.
import unittest.py
0 → 100644
+
50
−
0
View file @
daa04da6
import
unittest
from
abc
import
ABC
,
abstractmethod
#Interface für Counter
class
ICounter
(
ABC
):
@abstractmethod
def
count_ED
(
self
,
s
):
pass
# Implementierung Counter Klasse
class
Counter
(
ICounter
):
def
count_ED
(
self
,
s
):
s
=
s
.
upper
()
return
s
.
count
(
"
D
"
)
+
s
.
count
(
"
E
"
)
class
TextCounter
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
c
=
Counter
()
def
test_count_ED_regular
(
self
):
ergebnis
=
self
.
c
.
count_ED
(
"
Decker
"
)
self
.
assertEqual
(
ergebnis
,
3
)
def
test_count_ED_empty
(
self
):
ergebnis
=
self
.
c
.
count_ED
(
""
)
self
.
assertEqual
(
ergebnis
,
0
)
def
test_count_ED_wo
(
self
):
'''
Testet einen String ohne E und D
'''
ergebnis
=
self
.
c
.
count_ED
(
"
HAllo
"
)
self
.
assertEqual
(
ergebnis
,
0
)
def
test_count_ED_insensitive
(
self
):
'''
Testet verschiedene Groß- und Kleinschreibung
'''
ergebnis
=
self
.
c
.
count_ED
(
"
Der Esel
"
)
self
.
assertEqual
(
ergebnis
,
4
)
def
test_count_ED_single_letter
(
self
):
'''
Testet Eingaben mit nur einem Buchstaben
'''
ergebnis
=
self
.
c
.
count_ED
(
"
D
"
)
self
.
assertEqual
(
ergebnis
,
1
)
ergebnis
=
self
.
c
.
count_ED
(
"
E
"
)
self
.
assertEqual
(
ergebnis
,
1
)
ergebnis
=
self
.
c
.
count_ED
(
"
d
"
)
self
.
assertEqual
(
ergebnis
,
1
)
ergebnis
=
self
.
c
.
count_ED
(
"
e
"
)
self
.
assertEqual
(
ergebnis
,
1
)
if
__name__
==
"
__main__
"
:
unittest
.
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
modern-dev
@
54472fec
Subproject commit 54472fec053ca27eb7f5d63d3efa939ef226cd74
This diff is collapsed.
Click to expand it.
test.py
deleted
100644 → 0
+
0
−
1
View file @
119c3dac
print
(
"
hello world
"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment