Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BioFlow-Insight
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
shareFAIR
BioFlow-Insight
Merge requests
!7
Return non zero code on failure
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Return non zero code on failure
fail-ci-on-test-failure
into
main
Overview
0
Commits
12
Pipelines
10
Changes
11
Merged
Bryan Brancotte
requested to merge
fail-ci-on-test-failure
into
main
1 year ago
Overview
0
Commits
12
Pipelines
10
Changes
1
Expand
0
0
Merge request reports
Viewing commit
e1a179dc
Prev
Next
Show latest version
1 file
+
2
−
12
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
e1a179dc
Factorize redundant tests
· e1a179dc
Bryan Brancotte
authored
1 year ago
tests/test_code.py
+
2
−
12
Options
@@ -3,18 +3,6 @@ from src.code_ import *
class
TestCode
(
unittest
.
TestCase
):
def
test_initialise
(
self
):
with
open
(
"
tests/ressources/outils/remove_comments_with.nf
"
,
'
r
'
)
as
f
:
code_with_comments
=
f
.
read
()
with
open
(
"
tests/ressources/outils/remove_comments_wo.nf
"
,
'
r
'
)
as
f
:
code_wo_comments
=
f
.
read
()
code
=
Code
(
code_with_comments
,
origin
=
None
)
self
.
assertIsInstance
(
code
,
Code
)
self
.
assertEqual
(
code
.
code
,
'
\n
'
+
code_with_comments
+
'
\n
'
)
self
.
assertEqual
(
code
.
code_wo_comments
,
'
\n
'
+
code_wo_comments
+
'
\n
'
)
def
test_get_code
(
self
):
with
open
(
"
tests/ressources/outils/remove_comments_with.nf
"
,
'
r
'
)
as
f
:
code_with_comments
=
f
.
read
()
@@ -23,5 +11,7 @@ class TestCode(unittest.TestCase):
code_wo_comments
=
f
.
read
()
code
=
Code
(
code_with_comments
,
origin
=
None
)
self
.
assertEqual
(
code
.
code
,
'
\n
'
+
code_with_comments
+
'
\n
'
)
self
.
assertEqual
(
code
.
code_wo_comments
,
'
\n
'
+
code_wo_comments
+
'
\n
'
)
self
.
assertEqual
(
code
.
get_code
(),
code_wo_comments
.
strip
())
Loading