mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-10-08 07:18:12 +08:00
Moved prometheus monitoring into flask blueprint
This commit is contained in:
committed by
Alok Saldanha
parent
d5008893f7
commit
0f79e1a010
@@ -1,7 +1,9 @@
|
||||
import unittest
|
||||
from unittest.mock import MagicMock, Mock, patch
|
||||
|
||||
from cellxgene_gateway.gateway import app
|
||||
from flask import Flask
|
||||
|
||||
from cellxgene_gateway.gateway_blueprint import gateway_blueprint
|
||||
from cellxgene_gateway.items.item import ItemType
|
||||
from cellxgene_gateway.items.s3.s3item import S3Item
|
||||
from cellxgene_gateway.items.s3.s3item_source import S3ItemSource
|
||||
@@ -82,6 +84,8 @@ class TestScanDirectory(unittest.TestCase):
|
||||
|
||||
s3func.return_value = S3Mock
|
||||
source = S3ItemSource("my-bucket")
|
||||
app = Flask(__name__)
|
||||
app.register_blueprint(gateway_blueprint)
|
||||
with app.test_request_context(query_string="refresh=true") as test_context:
|
||||
tree = source.scan_directory()
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from flask import Flask
|
||||
from cellxgene_gateway import flask_util
|
||||
from cellxgene_gateway.cache_entry import CacheEntry, CacheEntryStatus
|
||||
from cellxgene_gateway.cache_key import CacheKey
|
||||
from cellxgene_gateway.gateway import app
|
||||
from cellxgene_gateway.gateway_blueprint import gateway_blueprint
|
||||
from cellxgene_gateway.items.file.fileitem import FileItem
|
||||
from cellxgene_gateway.items.file.fileitem_source import FileItemSource
|
||||
from cellxgene_gateway.items.item import ItemType
|
||||
@@ -18,7 +18,8 @@ key = CacheKey(
|
||||
|
||||
class TestRenderEntry(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.app = app
|
||||
self.app = Flask(__name__)
|
||||
self.app.register_blueprint(gateway_blueprint)
|
||||
self.app_context = self.app.test_request_context()
|
||||
self.app_context.push()
|
||||
self.client = self.app.test_client()
|
||||
|
||||
Reference in New Issue
Block a user