Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moder dev
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
Hatice Yildirim
moder dev
Commits
073340d6
Commit
073340d6
authored
3 weeks ago
by
Hatice Yildirim
Browse files
Options
Downloads
Patches
Plain Diff
Remove counter.py and calculator.py
parent
de90d7a1
No related branches found
No related tags found
1 merge request
!1
RomanConverter
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
calculator.py
+0
-13
0 additions, 13 deletions
calculator.py
counter.py
+0
-53
0 additions, 53 deletions
counter.py
with
0 additions
and
66 deletions
calculator.py
deleted
100644 → 0
+
0
−
13
View file @
de90d7a1
import
unittest
class
Calculator
:
def
add
(
self
,
a
,
b
):
return
a
+
b
class
TestCalculator
(
unittest
.
TestCase
):
def
test_add
(
self
):
c
=
Calculator
()
self
.
assertEqual
(
c
.
add
(
2
,
3
),
5
)
if
__name__
==
'
__main__
'
:
unittest
.
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
counter.py
deleted
100644 → 0
+
0
−
53
View file @
de90d7a1
#Bei Einhabe des Strings "Decker" liefert die Funktion 3
#Bei Eingabe eines leeren Strings soll 0 ausgegeben werden
#Bei Eingabe des Strings "Hallo" ohne E und D soll 0 ausgegeben werden
from
abc
import
ABC
,
abstractmethod
import
unittest
class
ICounter
(
ABC
):
@abstractmethod
def
count_ED
(
self
,
s
):
pass
class
Counter
(
ICounter
):
def
count_ED
(
self
,
s
):
s
=
s
.
upper
()
return
s
.
count
(
"
D
"
)
+
s
.
count
(
"
E
"
)
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
):
'''
Testet einen String ohne E und D
'''
res
=
self
.
c
.
count_ED
(
"
Hallo
"
)
self
.
assertEqual
(
res
,
0
)
def
test_count_ED_insensitive
(
self
):
'''
Testet verschiedene Groß- und Kleinschreibungen
'''
res
=
self
.
c
.
count_ED
(
"
Der Esel
"
)
self
.
assertEqual
(
res
,
4
)
def
test_count_ED_single_letter
(
self
):
'''
Testet Eingaben mit nur einem Buchstaben
'''
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
)
res
=
self
.
c
.
count_ED
(
"
e
"
)
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