Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Modern_Dev_MA
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
Muhamed Alici
Modern_Dev_MA
Commits
4ac892c0
Commit
4ac892c0
authored
3 months ago
by
Muhamed
Browse files
Options
Downloads
Patches
Plain Diff
added wasili tests
parent
0d85a0c3
No related branches found
No related tags found
No related merge requests found
Pipeline
#20183
failed
3 months ago
Stage: build
Stage: test
Stage: dast
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Test_Converter_Römische_Zahlen.py
+26
-4
26 additions, 4 deletions
Test_Converter_Römische_Zahlen.py
report.md
+1
-0
1 addition, 0 deletions
report.md
with
27 additions
and
4 deletions
Test_Converter_Römische_Zahlen.py
+
26
−
4
View file @
4ac892c0
...
@@ -5,7 +5,7 @@ from abc import ABC, abstractmethod
...
@@ -5,7 +5,7 @@ from abc import ABC, abstractmethod
#from muhamed_directory.other.alma.test2converter import RomanNumber as Alma
#from muhamed_directory.other.alma.test2converter import RomanNumber as Alma
#from muhamed_directory.other.daniel.converter import Converter as Dani
#from muhamed_directory.other.daniel.converter import Converter as Dani
#from muhamed_directory.other.hatice.converter import RomanNumber as Hati
#from muhamed_directory.other.hatice.converter import RomanNumber as Hati
from
muhamed_directory.other.wasili.TDD_Converter
import
RomanNumber
as
was
#
from muhamed_directory.other.wasili.TDD_Converter import RomanNumber as was
class
IStringCalculator
(
ABC
):
class
IStringCalculator
(
ABC
):
@abstractmethod
@abstractmethod
...
@@ -26,9 +26,30 @@ class Converter(IStringCalculator):
...
@@ -26,9 +26,30 @@ class Converter(IStringCalculator):
result
+=
roman_numerals
[
value
]
result
+=
roman_numerals
[
value
]
n
-=
value
n
-=
value
return
result
return
result
class
TestRomanNumber
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
r
=
Converter
def
test_convert_1
(
self
):
self
.
assertEqual
(
self
.
r
.
convert
(
1
),
"
I
"
)
def
test_convert_21
(
self
):
self
.
assertEqual
(
self
.
r
.
convert
(
21
),
"
XXI
"
)
def
test_convert_empty
(
self
):
self
.
assertEqual
(
self
.
r
.
convert
(
None
),
"
Fehler: Bitte Zahl eingeben
"
)
def
test_convert_string
(
self
):
self
.
assertEqual
(
self
.
r
.
convert
(
"
Hello
"
),
"
Fehler: Bitte Zahl eingeben
"
)
def
test_convert_downzero
(
self
):
self
.
assertEqual
(
self
.
r
.
convert
(
-
5
),
"
Integer muss größer als 0 sein
"
)
def
test_convert_downzero
(
self
):
self
.
assertEqual
(
self
.
r
.
convert
(
1000
),
"
M
"
)
'''
class TestRomanConverter(unittest.TestCase):
class
TestRomanConverter
(
unittest
.
TestCase
):
def setUp(self):
def setUp(self):
self.calculator = was
self.calculator = was
...
@@ -52,7 +73,7 @@ class TestRomanConverter(unittest.TestCase):
...
@@ -52,7 +73,7 @@ class TestRomanConverter(unittest.TestCase):
self.assertEqual(self.calculator.convert_int_to_str(1000),
"
M
"
)
self.assertEqual(self.calculator.convert_int_to_str(1000),
"
M
"
)
def test_1999(self):
def test_1999(self):
self
.
assertEqual
(
self
.
calculator
.
convert_int_to_str
(
1999
),
"
MCMXCIX
"
)
self.assertEqual(self.calculator.convert_int_to_str(1999),
"
MCMXCIX
"
)
'''
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
unittest
.
main
()
unittest
.
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
report.md
+
1
−
0
View file @
4ac892c0
...
@@ -8,3 +8,4 @@
...
@@ -8,3 +8,4 @@
| ich vs Hatice Tests | no | 1 | FAIL: test_inivalid_numbers (__main__.TestRomanConverter.test_inivalid_numbers) |
| ich vs Hatice Tests | no | 1 | FAIL: test_inivalid_numbers (__main__.TestRomanConverter.test_inivalid_numbers) |
| Lasse | yes | all | TypeError: RomanNumerals.to_roman() missing 1 required positional argument: 'num' |
| Lasse | yes | all | TypeError: RomanNumerals.to_roman() missing 1 required positional argument: 'num' |
| Wasili | yes | all | TypeError: RomanNumber.convert_int_to_str() missing 1 required positional argument: 'n' |
| Wasili | yes | all | TypeError: RomanNumber.convert_int_to_str() missing 1 required positional argument: 'n' |
| ich vs wasili Tests | no | 2 | TypeError: '>=' not supported between instances of 'str' and 'int') |
\ 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