Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pulsar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
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
Code review analytics
Issue 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
NDIP
Pulsar
Commits
9771fb86
Commit
9771fb86
authored
10 years ago
by
John Chilton
Browse files
Options
Downloads
Patches
Plain Diff
More PEP8-y test helper names.
parent
c06a559d
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
test/amqp_test.py
+2
-2
2 additions, 2 deletions
test/amqp_test.py
test/integration_test.py
+12
-12
12 additions, 12 deletions
test/integration_test.py
test/manager_drmaa_test.py
+3
-3
3 additions, 3 deletions
test/manager_drmaa_test.py
test/test_utils.py
+5
-5
5 additions, 5 deletions
test/test_utils.py
with
22 additions
and
22 deletions
test/amqp_test.py
+
2
−
2
View file @
9771fb86
import
threading
import
threading
from
.test_utils
import
skip
U
nless
M
odule
from
.test_utils
import
skip
_u
nless
_m
odule
from
pulsar.client
import
amqp_exchange
from
pulsar.client
import
amqp_exchange
TEST_CONNECTION
=
"
memory://test_amqp
"
TEST_CONNECTION
=
"
memory://test_amqp
"
@skip
U
nless
M
odule
(
"
kombu
"
)
@skip
_u
nless
_m
odule
(
"
kombu
"
)
def
test_amqp
():
def
test_amqp
():
manager1_exchange
=
amqp_exchange
.
PulsarExchange
(
TEST_CONNECTION
,
"
manager_test
"
)
manager1_exchange
=
amqp_exchange
.
PulsarExchange
(
TEST_CONNECTION
,
"
manager_test
"
)
manager3_exchange
=
amqp_exchange
.
PulsarExchange
(
TEST_CONNECTION
,
"
manager3_test
"
)
manager3_exchange
=
amqp_exchange
.
PulsarExchange
(
TEST_CONNECTION
,
"
manager3_test
"
)
...
...
This diff is collapsed.
Click to expand it.
test/integration_test.py
+
12
−
12
View file @
9771fb86
...
@@ -4,9 +4,9 @@ from six import next, itervalues
...
@@ -4,9 +4,9 @@ from six import next, itervalues
from
six.moves
import
configparser
from
six.moves
import
configparser
from
.test_utils
import
(
from
.test_utils
import
(
TempDirectoryTestCase
,
TempDirectoryTestCase
,
skip
U
nless
E
xecutable
,
skip
_u
nless
_e
xecutable
,
skip
U
nless
M
odule
,
skip
_u
nless
_m
odule
,
skip
U
nless
AnyM
odule
skip
_u
nless
_any_m
odule
)
)
from
.test_utils
import
test_pulsar_app
from
.test_utils
import
test_pulsar_app
...
@@ -96,7 +96,7 @@ class IntegrationTests(BaseIntegrationTest):
...
@@ -96,7 +96,7 @@ class IntegrationTests(BaseIntegrationTest):
def
test_integration_no_requirement
(
self
):
def
test_integration_no_requirement
(
self
):
self
.
_run
(
private_token
=
None
,
**
self
.
default_kwargs
)
self
.
_run
(
private_token
=
None
,
**
self
.
default_kwargs
)
@skip
U
nless
M
odule
(
"
drmaa
"
)
@skip
_u
nless
_m
odule
(
"
drmaa
"
)
def
test_integration_as_user
(
self
):
def
test_integration_as_user
(
self
):
job_props
=
{
'
type
'
:
'
queued_external_drmaa
'
,
"
production
"
:
"
false
"
}
job_props
=
{
'
type
'
:
'
queued_external_drmaa
'
,
"
production
"
:
"
false
"
}
self
.
_run
(
job_conf_props
=
job_props
,
private_token
=
None
,
default_file_action
=
"
copy
"
,
user
=
'
u1
'
,
**
self
.
default_kwargs
)
self
.
_run
(
job_conf_props
=
job_props
,
private_token
=
None
,
default_file_action
=
"
copy
"
,
user
=
'
u1
'
,
**
self
.
default_kwargs
)
...
@@ -104,8 +104,8 @@ class IntegrationTests(BaseIntegrationTest):
...
@@ -104,8 +104,8 @@ class IntegrationTests(BaseIntegrationTest):
def
test_integration_local_setup
(
self
):
def
test_integration_local_setup
(
self
):
self
.
_run
(
private_token
=
None
,
default_file_action
=
"
remote_copy
"
,
local_setup
=
True
,
**
self
.
default_kwargs
)
self
.
_run
(
private_token
=
None
,
default_file_action
=
"
remote_copy
"
,
local_setup
=
True
,
**
self
.
default_kwargs
)
@skip
U
nless
M
odule
(
"
pycurl
"
)
@skip
_u
nless
_m
odule
(
"
pycurl
"
)
@skip
U
nless
M
odule
(
"
kombu
"
)
@skip
_u
nless
_m
odule
(
"
kombu
"
)
def
test_message_queue
(
self
):
def
test_message_queue
(
self
):
self
.
_run
(
self
.
_run
(
app_conf
=
dict
(
message_queue_url
=
"
memory://test1
"
),
app_conf
=
dict
(
message_queue_url
=
"
memory://test1
"
),
...
@@ -128,7 +128,7 @@ class IntegrationTests(BaseIntegrationTest):
...
@@ -128,7 +128,7 @@ class IntegrationTests(BaseIntegrationTest):
def
test_integration_default
(
self
):
def
test_integration_default
(
self
):
self
.
_run
(
private_token
=
None
,
**
self
.
default_kwargs
)
self
.
_run
(
private_token
=
None
,
**
self
.
default_kwargs
)
@skip
U
nless
M
odule
(
"
pycurl
"
)
@skip
_u
nless
_m
odule
(
"
pycurl
"
)
def
test_integration_curl
(
self
):
def
test_integration_curl
(
self
):
self
.
_run
(
private_token
=
None
,
transport
=
"
curl
"
,
**
self
.
default_kwargs
)
self
.
_run
(
private_token
=
None
,
transport
=
"
curl
"
,
**
self
.
default_kwargs
)
...
@@ -138,19 +138,19 @@ class IntegrationTests(BaseIntegrationTest):
...
@@ -138,19 +138,19 @@ class IntegrationTests(BaseIntegrationTest):
def
test_integration_errors
(
self
):
def
test_integration_errors
(
self
):
self
.
_run
(
app_conf
=
{
"
private_token
"
:
"
testtoken
"
},
private_token
=
"
testtoken
"
,
test_errors
=
True
,
**
self
.
default_kwargs
)
self
.
_run
(
app_conf
=
{
"
private_token
"
:
"
testtoken
"
},
private_token
=
"
testtoken
"
,
test_errors
=
True
,
**
self
.
default_kwargs
)
@skip
U
nless
M
odule
(
"
drmaa
"
)
@skip
_u
nless
_m
odule
(
"
drmaa
"
)
def
test_integration_drmaa
(
self
):
def
test_integration_drmaa
(
self
):
self
.
_run
(
app_conf
=
{},
job_conf_props
=
{
'
type
'
:
'
queued_drmaa
'
},
private_token
=
None
,
**
self
.
default_kwargs
)
self
.
_run
(
app_conf
=
{},
job_conf_props
=
{
'
type
'
:
'
queued_drmaa
'
},
private_token
=
None
,
**
self
.
default_kwargs
)
@skip
U
nless
E
xecutable
(
"
condor_submit
"
)
@skip
_u
nless
_e
xecutable
(
"
condor_submit
"
)
def
test_integration_condor
(
self
):
def
test_integration_condor
(
self
):
self
.
_run
(
app_conf
=
{},
job_conf_props
=
{
'
type
'
:
'
queued_condor
'
},
private_token
=
None
,
**
self
.
default_kwargs
)
self
.
_run
(
app_conf
=
{},
job_conf_props
=
{
'
type
'
:
'
queued_condor
'
},
private_token
=
None
,
**
self
.
default_kwargs
)
@skip
U
nless
E
xecutable
(
"
qsub
"
)
@skip
_u
nless
_e
xecutable
(
"
qsub
"
)
def
test_integration_cli_torque
(
self
):
def
test_integration_cli_torque
(
self
):
self
.
_run
(
app_conf
=
{},
job_conf_props
=
{
'
type
'
:
'
queued_cli
'
,
'
job_plugin
'
:
'
Torque
'
},
private_token
=
None
,
**
self
.
default_kwargs
)
self
.
_run
(
app_conf
=
{},
job_conf_props
=
{
'
type
'
:
'
queued_cli
'
,
'
job_plugin
'
:
'
Torque
'
},
private_token
=
None
,
**
self
.
default_kwargs
)
@skip
U
nless
E
xecutable
(
"
sbatch
"
)
@skip
_u
nless
_e
xecutable
(
"
sbatch
"
)
def
test_integration_cli_slurm
(
self
):
def
test_integration_cli_slurm
(
self
):
self
.
_run
(
app_conf
=
{},
job_conf_props
=
{
'
type
'
:
'
queued_cli
'
,
'
job_plugin
'
:
'
Slurm
'
},
private_token
=
None
,
**
self
.
default_kwargs
)
self
.
_run
(
app_conf
=
{},
job_conf_props
=
{
'
type
'
:
'
queued_cli
'
,
'
job_plugin
'
:
'
Slurm
'
},
private_token
=
None
,
**
self
.
default_kwargs
)
...
@@ -158,7 +158,7 @@ class IntegrationTests(BaseIntegrationTest):
...
@@ -158,7 +158,7 @@ class IntegrationTests(BaseIntegrationTest):
class
DirectIntegrationTests
(
IntegrationTests
):
class
DirectIntegrationTests
(
IntegrationTests
):
default_kwargs
=
dict
(
direct_interface
=
True
,
test_requirement
=
False
)
default_kwargs
=
dict
(
direct_interface
=
True
,
test_requirement
=
False
)
@skip
U
nless
AnyM
odule
([
"
pycurl
"
,
"
poster
"
,
"
requests_toolbelt
"
])
@skip
_u
nless
_any_m
odule
([
"
pycurl
"
,
"
poster
"
,
"
requests_toolbelt
"
])
def
test_integration_remote_transfer
(
self
):
def
test_integration_remote_transfer
(
self
):
self
.
_run
(
self
.
_run
(
private_token
=
None
,
private_token
=
None
,
...
...
This diff is collapsed.
Click to expand it.
test/manager_drmaa_test.py
+
3
−
3
View file @
9771fb86
from
.test_utils
import
(
from
.test_utils
import
(
BaseManagerTestCase
,
BaseManagerTestCase
,
skip
U
nless
M
odule
skip
_u
nless
_m
odule
)
)
from
pulsar.managers.queued_drmaa
import
DrmaaQueueManager
from
pulsar.managers.queued_drmaa
import
DrmaaQueueManager
...
@@ -19,10 +19,10 @@ class DrmaaManagerTest(BaseManagerTestCase):
...
@@ -19,10 +19,10 @@ class DrmaaManagerTest(BaseManagerTestCase):
def
_set_manager
(
self
,
**
kwds
):
def
_set_manager
(
self
,
**
kwds
):
self
.
manager
=
DrmaaQueueManager
(
'
_default_
'
,
self
.
app
,
**
kwds
)
self
.
manager
=
DrmaaQueueManager
(
'
_default_
'
,
self
.
app
,
**
kwds
)
@skip
U
nless
M
odule
(
"
drmaa
"
)
@skip
_u
nless
_m
odule
(
"
drmaa
"
)
def
test_simple_execution
(
self
):
def
test_simple_execution
(
self
):
self
.
_test_simple_execution
(
self
.
manager
)
self
.
_test_simple_execution
(
self
.
manager
)
@skip
U
nless
M
odule
(
"
drmaa
"
)
@skip
_u
nless
_m
odule
(
"
drmaa
"
)
def
test_cancel
(
self
):
def
test_cancel
(
self
):
self
.
_test_cancelling
(
self
.
manager
)
self
.
_test_cancelling
(
self
.
manager
)
This diff is collapsed.
Click to expand it.
test/test_utils.py
+
5
−
5
View file @
9771fb86
...
@@ -250,13 +250,13 @@ def test_pulsar_app(global_conf={}, app_conf={}, test_conf={}):
...
@@ -250,13 +250,13 @@ def test_pulsar_app(global_conf={}, app_conf={}, test_conf={}):
pass
pass
def
skip
U
nless
E
xecutable
(
executable
):
def
skip
_u
nless
_e
xecutable
(
executable
):
if
_
_which
(
executable
):
if
_which
(
executable
):
return
lambda
func
:
func
return
lambda
func
:
func
return
skip
(
"
PATH doesn
'
t contain executable %s
"
%
executable
)
return
skip
(
"
PATH doesn
'
t contain executable %s
"
%
executable
)
def
skip
U
nless
M
odule
(
module
):
def
skip
_u
nless
_m
odule
(
module
):
available
=
True
available
=
True
try
:
try
:
__import__
(
module
)
__import__
(
module
)
...
@@ -267,7 +267,7 @@ def skipUnlessModule(module):
...
@@ -267,7 +267,7 @@ def skipUnlessModule(module):
return
skip
(
"
Module %s could not be loaded, dependent test skipped.
"
%
module
)
return
skip
(
"
Module %s could not be loaded, dependent test skipped.
"
%
module
)
def
skip
U
nless
AnyM
odule
(
modules
):
def
skip
_u
nless
_any_m
odule
(
modules
):
available
=
False
available
=
False
for
module
in
modules
:
for
module
in
modules
:
try
:
try
:
...
@@ -280,7 +280,7 @@ def skipUnlessAnyModule(modules):
...
@@ -280,7 +280,7 @@ def skipUnlessAnyModule(modules):
return
skip
(
"
None of the modules %s could be loaded, dependent test skipped.
"
%
modules
)
return
skip
(
"
None of the modules %s could be loaded, dependent test skipped.
"
%
modules
)
def
_
_which
(
program
):
def
_which
(
program
):
def
is_exe
(
fpath
):
def
is_exe
(
fpath
):
return
isfile
(
fpath
)
and
access
(
fpath
,
X_OK
)
return
isfile
(
fpath
)
and
access
(
fpath
,
X_OK
)
...
...
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