Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Data Logistics Service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
eFlows4HPC WP2
Data Logistics Service
Commits
fdf67c82
Commit
fdf67c82
authored
3 years ago
by
Jedrzej Rybicki
Browse files
Options
Downloads
Patches
Plain Diff
params in dag
parent
954f3448
No related branches found
No related tags found
No related merge requests found
Pipeline
#78281
failed
3 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_b2shareoperator.py
+5
-3
5 additions, 3 deletions
tests/test_b2shareoperator.py
with
5 additions
and
3 deletions
tests/test_b2shareoperator.py
+
5
−
3
View file @
fdf67c82
...
@@ -4,13 +4,15 @@ from airflow.utils.dates import days_ago
...
@@ -4,13 +4,15 @@ from airflow.utils.dates import days_ago
from
dags.b2shareoperator
import
B2ShareOperator
from
dags.b2shareoperator
import
B2ShareOperator
from
airflow
import
DAG
from
airflow
import
DAG
from
airflow.models.taskinstance
import
TaskInstance
from
airflow.models.taskinstance
import
TaskInstance
from
tests.test_utils.config
import
conf_vars
DEFAULT_DATE
=
'
2019-10-03
'
DEFAULT_DATE
=
'
2019-10-03
'
TEST_DAG_ID
=
'
test_my_custom_operator
'
TEST_DAG_ID
=
'
test_my_custom_operator
'
class
B2ShareOperatorTest
(
unittest
.
TestCase
):
class
B2ShareOperatorTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
dag
=
DAG
(
TEST_DAG_ID
,
schedule_interval
=
'
@daily
'
,
default_args
=
{
'
start_date
'
:
days_ago
(
2
)})
self
.
dag
=
DAG
(
TEST_DAG_ID
,
schedule_interval
=
'
@daily
'
,
default_args
=
{
'
start_date
'
:
days_ago
(
2
)}
,
params
=
{
"
oid
"
:
"
111
"
}
)
self
.
op
=
B2ShareOperator
(
self
.
op
=
B2ShareOperator
(
dag
=
self
.
dag
,
dag
=
self
.
dag
,
task_id
=
'
test
'
,
task_id
=
'
test
'
,
...
@@ -19,8 +21,8 @@ class B2ShareOperatorTest(unittest.TestCase):
...
@@ -19,8 +21,8 @@ class B2ShareOperatorTest(unittest.TestCase):
self
.
ti
=
TaskInstance
(
task
=
self
.
op
,
execution_date
=
days_ago
(
1
))
self
.
ti
=
TaskInstance
(
task
=
self
.
op
,
execution_date
=
days_ago
(
1
))
def
test_execute_no_trigger
(
self
):
def
test_execute_no_trigger
(
self
):
#with conf_vars({('params': {'oid': 1111})}):
self
.
ti
.
run
(
ignore_ti_state
=
False
,
context
=
{
'
params
'
:
{
'
oid
'
:
111
}}
)
self
.
ti
.
run
(
ignore_ti_state
=
False
)
print
(
self
.
ti
.
state
)
print
(
self
.
ti
.
state
)
self
.
assertEqual
(
State
.
SUCCESS
,
self
.
ti
.
state
)
self
.
assertEqual
(
State
.
SUCCESS
,
self
.
ti
.
state
)
# Assert something related to tasks results
# Assert something related to tasks results
\ 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