Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Praxisprojekt Technologiebasierte Innovationen
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
Daniel Rafeh
Praxisprojekt Technologiebasierte Innovationen
Commits
8c6df414
Commit
8c6df414
authored
1 month ago
by
Daniel Rafeh
Browse files
Options
Downloads
Patches
Plain Diff
Delete counter.py
parent
4de27f12
No related branches found
No related tags found
No related merge requests found
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
counter.py
+0
-55
0 additions, 55 deletions
counter.py
with
0 additions
and
55 deletions
counter.py
deleted
100644 → 0
+
0
−
55
View file @
4de27f12
from
abc
import
ABC
,
abstractmethod
import
unittest
# Bei Eingabe des Strings Decker liegert die Funktion 3
# Bei Eingabe eines leeren Strings soll 0 ausgegeben werden
# Bei Eingabe des Strings Hallo soll 0 ausgegeben werden
# Bei Eingabe von Groß-/Kleinschreibung soll trotzdem der entsprechende Wert rauskommen
# Bei Eingabe vom Buchstaben D oder E soll trotzdem die 1 rauskommen
class
ICounter
(
ABC
):
@abstractmethod
def
count_ED
(
self
,
s
):
pass
class
Counter
(
ICounter
):
def
count_ED
(
self
,
s
):
s
=
s
.
upper
()
return
s
.
count
(
"
E
"
)
+
s
.
count
(
"
D
"
)
class
TestCounter
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
c
=
Counter
()
def
test_count_ED_regular
(
self
):
res
=
self
.
c
.
count_ED
(
"
Decker
"
)
self
.
assertEqual
(
res
,
3
)
def
test_count_ED_empty
(
self
):
res
=
self
.
c
.
count_ED
(
"
"
)
self
.
assertEqual
(
res
,
0
)
def
test_count_ED_wo
(
self
):
res
=
self
.
c
.
count_ED
(
"
Hallo
"
)
self
.
assertEqual
(
res
,
0
)
def
test_count_ED_insensetiv
(
self
):
res
=
self
.
c
.
count_ED
(
"
Der Esel
"
)
self
.
assertEqual
(
res
,
4
)
def
test_count_ED_oneL
(
self
):
res
=
self
.
c
.
count_ED
(
'
E
'
)
self
.
assertEqual
(
res
,
1
)
res
=
self
.
c
.
count_ED
(
'
D
'
)
self
.
assertEqual
(
res
,
1
)
res
=
self
.
c
.
count_ED
(
'
e
'
)
self
.
assertEqual
(
res
,
1
)
res
=
self
.
c
.
count_ED
(
'
d
'
)
self
.
assertEqual
(
res
,
1
)
if
__name__
==
"
__main__
"
:
unittest
.
main
()
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