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
303e96ce
Commit
303e96ce
authored
10 years ago
by
John Chilton
Browse files
Options
Downloads
Patches
Plain Diff
Fix more fallout from daemon.py -> main.py.
parent
735b4f2c
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
docs/pulsar.rst
+6
-6
6 additions, 6 deletions
docs/pulsar.rst
test/main_util_test.py
+11
-11
11 additions, 11 deletions
test/main_util_test.py
with
17 additions
and
17 deletions
docs/pulsar.rst
+
6
−
6
View file @
303e96ce
...
...
@@ -26,18 +26,18 @@ pulsar.core module
:undoc-members:
:show-inheritance:
pulsar.
daemon
module
-------------------
-
pulsar.
locks
module
-------------------
.. automodule:: pulsar.
daemon
.. automodule:: pulsar.
locks
:members:
:undoc-members:
:show-inheritance:
pulsar.
locks
module
------------------
-
pulsar.
main
module
------------------
.. automodule:: pulsar.
locks
.. automodule:: pulsar.
main
:members:
:undoc-members:
:show-inheritance:
...
...
This diff is collapsed.
Click to expand it.
test/
daemo
n_util_test.py
→
test/
mai
n_util_test.py
+
11
−
11
View file @
303e96ce
"""
Test utilities in pulsar.
daemo
n
"""
"""
Test utilities in pulsar.
mai
n
"""
from
os.path
import
join
from
test_utils
import
temp_directory
from
pulsar
import
daemo
n
from
pulsar
import
mai
n
def
test_pulsar_config_builder_defaults
():
with
temp_directory
()
as
mock_root
:
__write_mock_ini
(
join
(
mock_root
,
"
server.ini
"
))
config
=
daemo
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
)
config
=
mai
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
)
assert
config
.
load
()[
"
foo
"
]
==
"
bar1
"
def
test_pulsar_config_builder_defaults_sample
():
with
temp_directory
()
as
mock_root
:
__write_mock_ini
(
join
(
mock_root
,
"
server.ini.sample
"
))
config
=
daemo
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
)
config
=
mai
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
)
assert
config
.
load
()[
"
foo
"
]
==
"
bar1
"
def
test_pulsar_config_builder_specified_ini
():
with
temp_directory
()
as
mock_root
:
__write_mock_ini
(
join
(
mock_root
,
"
moo.ini
"
))
config
=
daemo
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
,
ini_path
=
"
moo.ini
"
)
config
=
mai
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
,
ini_path
=
"
moo.ini
"
)
assert
config
.
load
()[
"
foo
"
]
==
"
bar1
"
def
test_pulsar_config_builder_specified_ini_args
():
with
temp_directory
()
as
mock_root
:
__write_mock_ini
(
join
(
mock_root
,
"
moo.ini
"
),
app
=
"
cool1
"
)
config
=
daemo
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
,
args
=
MockArgs
(
"
moo.ini
"
,
"
cool1
"
))
config
=
mai
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
,
args
=
MockArgs
(
"
moo.ini
"
,
"
cool1
"
))
assert
config
.
load
()[
"
foo
"
]
==
"
bar1
"
def
test_pulsar_config_builder_specified_app
():
with
temp_directory
()
as
mock_root
:
__write_mock_ini
(
join
(
mock_root
,
"
server.ini
"
),
app
=
"
cool1
"
)
config
=
daemo
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
,
app
=
"
cool1
"
)
config
=
mai
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
,
app
=
"
cool1
"
)
assert
config
.
load
()[
"
foo
"
]
==
"
bar1
"
...
...
@@ -43,7 +43,7 @@ def test_pulsar_config_builder_app_yaml():
with
temp_directory
()
as
mock_root
:
__write_mock_ini
(
join
(
mock_root
,
"
server.ini
"
))
open
(
join
(
mock_root
,
"
app.yml
"
),
"
w
"
).
write
(
"
foo: bar2
"
)
config
=
daemo
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
)
config
=
mai
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
)
assert
config
.
load
()[
"
foo
"
]
==
"
bar2
"
...
...
@@ -52,14 +52,14 @@ def test_pulsar_config_builder_override_app_yaml():
app_yaml_path
=
join
(
mock_root
,
"
new_app.yml
"
)
__write_mock_ini
(
join
(
mock_root
,
"
server.ini
"
),
extra
=
"
app_config=%s
"
%
app_yaml_path
)
open
(
app_yaml_path
,
"
w
"
).
write
(
"
foo: bar2
"
)
config
=
daemo
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
)
config
=
mai
n
.
PulsarConfigBuilder
(
pulsar_root
=
mock_root
)
assert
config
.
load
()[
"
foo
"
]
==
"
bar2
"
def
test_pulsar_manager_config_builder_defaults
():
with
temp_directory
()
as
mock_root
:
__write_mock_ini
(
join
(
mock_root
,
"
server.ini
"
))
config
=
daemo
n
.
PulsarManagerConfigBuilder
(
pulsar_root
=
mock_root
)
config
=
mai
n
.
PulsarManagerConfigBuilder
(
pulsar_root
=
mock_root
)
config
.
load
()[
"
foo
"
]
==
"
bar1
"
as_dict
=
config
.
to_dict
()
assert
as_dict
[
"
manager
"
]
==
"
_default_
"
...
...
@@ -70,7 +70,7 @@ def test_pulsar_manager_config_builder_defaults():
def
test_pulsar_manager_config_builder_overrides
():
with
temp_directory
()
as
mock_root
:
__write_mock_ini
(
join
(
mock_root
,
"
pulsar5.ini
"
),
app
=
"
cool1
"
)
config
=
daemo
n
.
PulsarManagerConfigBuilder
(
pulsar_root
=
mock_root
,
app
=
"
cool1
"
,
ini_path
=
"
pulsar5.ini
"
,
manager
=
"
manager3
"
)
config
=
mai
n
.
PulsarManagerConfigBuilder
(
pulsar_root
=
mock_root
,
app
=
"
cool1
"
,
ini_path
=
"
pulsar5.ini
"
,
manager
=
"
manager3
"
)
config
.
load
()[
"
foo
"
]
==
"
bar1
"
as_dict
=
config
.
to_dict
()
assert
as_dict
[
"
manager
"
]
==
"
manager3
"
...
...
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