Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Assignement_02
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
Assignement_02
Commits
9b1b3c6d
Commit
9b1b3c6d
authored
3 weeks ago
by
Alma Berisha
Browse files
Options
Downloads
Patches
Plain Diff
Tests für Muhamed (Momo) hinzugefügt
parent
cef51c67
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test_me_on_momo.py
+28
-0
28 additions, 0 deletions
test_me_on_momo.py
test_momo_on_me.py
+32
-0
32 additions, 0 deletions
test_momo_on_me.py
with
60 additions
and
0 deletions
test_me_on_momo.py
0 → 100644
+
28
−
0
View file @
9b1b3c6d
import
unittest
import
importlib.util
def
load_student_convert
(
path
):
spec
=
importlib
.
util
.
spec_from_file_location
(
"
student_module
"
,
path
)
student_module
=
importlib
.
util
.
module_from_spec
(
spec
)
spec
.
loader
.
exec_module
(
student_module
)
return
student_module
.
convert
class
TestAliciImplementation
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
convert
=
load_student_convert
(
"
other/AliciMuhamed/RomanNumber.py
"
)
def
test_values
(
self
):
self
.
assertEqual
(
self
.
convert
(
3
),
"
III
"
)
self
.
assertEqual
(
self
.
convert
(
6
),
"
VI
"
)
self
.
assertEqual
(
self
.
convert
(
8
),
"
VIII
"
)
self
.
assertEqual
(
self
.
convert
(
12
),
"
XII
"
)
self
.
assertEqual
(
self
.
convert
(
17
),
"
XVII
"
)
self
.
assertEqual
(
self
.
convert
(
29
),
"
XXIX
"
)
self
.
assertEqual
(
self
.
convert
(
34
),
"
XXXIV
"
)
self
.
assertEqual
(
self
.
convert
(
55
),
"
LV
"
)
self
.
assertEqual
(
self
.
convert
(
101
),
"
CI
"
)
self
.
assertEqual
(
self
.
convert
(
501
),
"
DI
"
)
self
.
assertEqual
(
self
.
convert
(
1003
),
"
MIII
"
)
if
__name__
==
"
__main__
"
:
unittest
.
main
()
This diff is collapsed.
Click to expand it.
test_momo_on_me.py
0 → 100644
+
32
−
0
View file @
9b1b3c6d
import
unittest
from
my_romannumber
import
RomanNumber
def
convert
(
n
:
int
)
->
str
:
return
RomanNumber
().
convert
(
n
)
class
TestRomanConverter
(
unittest
.
TestCase
):
def
test_1
(
self
):
self
.
assertEqual
(
convert
(
1
),
"
I
"
)
def
test_10
(
self
):
self
.
assertEqual
(
convert
(
10
),
"
X
"
)
def
test_21
(
self
):
self
.
assertEqual
(
convert
(
21
),
"
XXI
"
)
def
test_50
(
self
):
self
.
assertEqual
(
convert
(
50
),
"
L
"
)
def
test_100
(
self
):
self
.
assertEqual
(
convert
(
100
),
"
C
"
)
def
test_1000
(
self
):
self
.
assertEqual
(
convert
(
1000
),
"
M
"
)
def
test_1999
(
self
):
self
.
assertEqual
(
convert
(
1999
),
"
MCMXCIX
"
)
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