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
Commits
99864c3f
Commit
99864c3f
authored
1 year ago
by
Bryan Brancotte
Browse files
Options
Downloads
Patches
Plain Diff
Ability to have empty file for in test_channel
parent
9237a7ee
No related branches found
No related tags found
1 merge request
!7
Return non zero code on failure
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_channel.py
+17
-9
17 additions, 9 deletions
tests/test_channel.py
with
17 additions
and
9 deletions
tests/test_channel.py
+
17
−
9
View file @
99864c3f
...
@@ -3,26 +3,34 @@ from src.channel import *
...
@@ -3,26 +3,34 @@ from src.channel import *
from
src.nextflow_file
import
Nextflow_File
from
src.nextflow_file
import
Nextflow_File
class
EmptyNextflowFile
(
Nextflow_File
):
def
__init__
(
self
,
address
=
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
,
*
args
,
**
kwargs
):
super
().
__init__
(
address
=
address
,
display_info
=
display_info
,
*
args
,
**
kwargs
)
def
check_file_correctness_after_DSL
(
self
):
return
class
TestChannel
(
unittest
.
TestCase
):
class
TestChannel
(
unittest
.
TestCase
):
def
test_get_code
(
self
):
def
test_get_code
(
self
):
wf1
=
Nextflow
_
File
(
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
)
wf1
=
Empty
NextflowFile
()
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
self
.
assertIsInstance
(
ch1
,
Channel
)
self
.
assertIsInstance
(
ch1
,
Channel
)
self
.
assertEqual
(
ch1
.
get_code
(),
"
ch1
"
)
self
.
assertEqual
(
ch1
.
get_code
(),
"
ch1
"
)
def
test_get_name
(
self
):
def
test_get_name
(
self
):
wf1
=
Nextflow
_
File
(
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
)
wf1
=
Empty
NextflowFile
()
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
self
.
assertEqual
(
ch1
.
get_name
(),
"
ch1
"
)
self
.
assertEqual
(
ch1
.
get_name
(),
"
ch1
"
)
def
test_get_type
(
self
):
def
test_get_type
(
self
):
wf1
=
Nextflow
_
File
(
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
)
wf1
=
Empty
NextflowFile
()
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
self
.
assertEqual
(
ch1
.
get_type
(),
"
Channel
"
)
self
.
assertEqual
(
ch1
.
get_type
(),
"
Channel
"
)
def
test_add_source
(
self
):
def
test_add_source
(
self
):
wf1
=
Nextflow
_
File
(
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
)
wf1
=
Empty
NextflowFile
()
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
self
.
assertEqual
(
ch1
.
get_source
(),
[])
self
.
assertEqual
(
ch1
.
get_source
(),
[])
ele
=
"
This is a test
"
ele
=
"
This is a test
"
...
@@ -30,7 +38,7 @@ class TestChannel(unittest.TestCase):
...
@@ -30,7 +38,7 @@ class TestChannel(unittest.TestCase):
self
.
assertEqual
(
ch1
.
get_source
(),
[
ele
])
self
.
assertEqual
(
ch1
.
get_source
(),
[
ele
])
def
test_add_sink
(
self
):
def
test_add_sink
(
self
):
wf1
=
Nextflow
_
File
(
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
)
wf1
=
Empty
NextflowFile
()
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
self
.
assertEqual
(
ch1
.
get_sink
(),
[])
self
.
assertEqual
(
ch1
.
get_sink
(),
[])
ele
=
"
This is a test
"
ele
=
"
This is a test
"
...
@@ -38,7 +46,7 @@ class TestChannel(unittest.TestCase):
...
@@ -38,7 +46,7 @@ class TestChannel(unittest.TestCase):
self
.
assertEqual
(
ch1
.
get_sink
(),
[
ele
])
self
.
assertEqual
(
ch1
.
get_sink
(),
[
ele
])
def
test_set_sink_null
(
self
):
def
test_set_sink_null
(
self
):
wf1
=
Nextflow
_
File
(
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
)
wf1
=
Empty
NextflowFile
()
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ele
=
"
This is a test
"
ele
=
"
This is a test
"
ch1
.
add_sink
(
ele
)
ch1
.
add_sink
(
ele
)
...
@@ -47,7 +55,7 @@ class TestChannel(unittest.TestCase):
...
@@ -47,7 +55,7 @@ class TestChannel(unittest.TestCase):
self
.
assertEqual
(
ch1
.
get_sink
(),
[])
self
.
assertEqual
(
ch1
.
get_sink
(),
[])
def
test_remove_element_from_sink
(
self
):
def
test_remove_element_from_sink
(
self
):
wf1
=
Nextflow
_
File
(
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
)
wf1
=
Empty
NextflowFile
()
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ele
=
"
This is a test
"
ele
=
"
This is a test
"
ch1
.
add_sink
(
ele
)
ch1
.
add_sink
(
ele
)
...
@@ -56,7 +64,7 @@ class TestChannel(unittest.TestCase):
...
@@ -56,7 +64,7 @@ class TestChannel(unittest.TestCase):
self
.
assertEqual
(
ch1
.
get_sink
(),
[])
self
.
assertEqual
(
ch1
.
get_sink
(),
[])
def
test_equal
(
self
):
def
test_equal
(
self
):
wf1
=
Nextflow
_
File
(
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
)
wf1
=
Empty
NextflowFile
()
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1_1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1_1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch2
=
Channel
(
name
=
"
ch2
"
,
origin
=
wf1
)
ch2
=
Channel
(
name
=
"
ch2
"
,
origin
=
wf1
)
...
@@ -64,7 +72,7 @@ class TestChannel(unittest.TestCase):
...
@@ -64,7 +72,7 @@ class TestChannel(unittest.TestCase):
self
.
assertFalse
(
ch1
.
equal
(
channel
=
ch2
))
self
.
assertFalse
(
ch1
.
equal
(
channel
=
ch2
))
def
test_get_structure
(
self
):
def
test_get_structure
(
self
):
wf1
=
Nextflow
_
File
(
"
tests/ressources/channel/empty_wf.nf
"
,
display_info
=
False
)
wf1
=
Empty
NextflowFile
()
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
ch1
=
Channel
(
name
=
"
ch1
"
,
origin
=
wf1
)
dico
=
{}
dico
=
{}
dico
[
'
nodes
'
]
=
[]
dico
[
'
nodes
'
]
=
[]
...
...
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