Introduce the virtualpdu entry point
This commit is contained in:
parent
5c228b775d
commit
c7b0872cbe
@ -23,6 +23,10 @@ classifier =
|
|||||||
packages =
|
packages =
|
||||||
virtualpdu
|
virtualpdu
|
||||||
|
|
||||||
|
[entry_points]
|
||||||
|
console_scripts =
|
||||||
|
virtualpdu = virtualpdu.main:main
|
||||||
|
|
||||||
[build_sphinx]
|
[build_sphinx]
|
||||||
source-dir = doc/source
|
source-dir = doc/source
|
||||||
build-dir = doc/build
|
build-dir = doc/build
|
||||||
@ -48,4 +52,4 @@ output_file = virtualpdu/locale/virtualpdu.pot
|
|||||||
[build_releasenotes]
|
[build_releasenotes]
|
||||||
all_files = 1
|
all_files = 1
|
||||||
build-dir = releasenotes/build
|
build-dir = releasenotes/build
|
||||||
source-dir = releasenotes/source
|
source-dir = releasenotes/source
|
||||||
|
4
virtualpdu/main.py
Normal file
4
virtualpdu/main.py
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
def main():
|
||||||
|
"""VirtualPDU Entry Point"""
|
||||||
|
|
||||||
|
print('VirtualPDU Entry Point')
|
30
virtualpdu/tests/integration/test_entrypoint.py
Normal file
30
virtualpdu/tests/integration/test_entrypoint.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# Copyright 2016 Internap
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import os
|
||||||
|
from virtualpdu.tests import base
|
||||||
|
|
||||||
|
|
||||||
|
class TestEntrypointIntegration(base.TestCase):
|
||||||
|
def test_entry_point_works(self):
|
||||||
|
self.assertEqual(
|
||||||
|
subprocess.check_output([
|
||||||
|
sys.executable, self._get_entrypoint_path('virtualpdu')]),
|
||||||
|
b'VirtualPDU Entry Point\n')
|
||||||
|
|
||||||
|
def _get_entrypoint_path(self, entrypoint):
|
||||||
|
return os.path.join(os.path.dirname(sys.executable), entrypoint)
|
Loading…
x
Reference in New Issue
Block a user