Skip to content

Commit

Permalink
Move server code into a subpackage
Browse files Browse the repository at this point in the history
  • Loading branch information
dhirving committed Oct 24, 2023
1 parent 02737b6 commit 282c84c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
28 changes: 28 additions & 0 deletions python/lsst/daf/butler/remote_butler/server/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file is part of daf_butler.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (http://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This software is dual licensed under the GNU General Public License and also
# under a 3-clause BSD license. Recipients may choose which of these licenses
# to use; please see the files gpl-3.0.txt and/or bsd_license.txt,
# respectively. If you choose the GPL option then the following text applies
# (but note that there is still no warranty even if you opt for BSD instead):
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from ._server import app
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
import unittest

try:
import lsst.daf.butler.remote_butler.server._server

# Failing to import any of these should disable the tests.
import lsst.daf.butler.server
from fastapi.testclient import TestClient
from lsst.daf.butler.remote_butler import RemoteButler
from lsst.daf.butler.server import app
from lsst.daf.butler.remote_butler.server._server import app
except ImportError:
TestClient = None
app = None
Expand Down Expand Up @@ -74,7 +75,7 @@ def setUpClass(cls):
# Globally change where the server thinks its butler repository
# is located. This will prevent any other server tests and is
# not a long term fix.
lsst.daf.butler.server.BUTLER_ROOT = cls.root
lsst.daf.butler.remote_butler.server._server.BUTLER_ROOT = cls.root
cls.client = TestClient(app)

cls.butler = _make_remote_butler(cls.client)
Expand Down

0 comments on commit 282c84c

Please sign in to comment.