示例#1
0
文件: test_g2p.py 项目: Ellmen/server
 def setUpClass(cls):
     config = {
         "DATA_SOURCE": paths.testDataRepo,
         "DEBUG": False
     }
     frontend.reset()
     frontend.configure(
         baseConfig="DevelopmentConfig", extraConfig=config)
     cls.app = frontend.app.test_client()
示例#2
0
文件: test_g2p.py 项目: ga4gh/server
 def setUpClass(cls):
     config = {
         "DATA_SOURCE": paths.testDataRepo,
         "DEBUG": False
     }
     frontend.reset()
     frontend.configure(
         baseConfig="DevelopmentConfig", extraConfig=config)
     cls.app = frontend.app.test_client()
示例#3
0
    def setUpClass(cls):
        config = {
            "DATA_SOURCE": "simulated://",
            "SIMULATED_BACKEND_RANDOM_SEED": 1111,
            "SIMULATED_BACKEND_NUM_CALLS": 1,
            "SIMULATED_BACKEND_VARIANT_DENSITY": 1.0,
            "SIMULATED_BACKEND_NUM_VARIANT_SETS": 1,
            "LANDING_MESSAGE_HTML": paths.landingMessageHtml
            # "DEBUG" : True
        }
        frontend.reset()
        frontend.configure(
            baseConfig="TestConfig", extraConfig=config)
        cls.app = frontend.app.test_client()
        # silence usually unhelpful CORS log
        logging.getLogger('ga4gh.frontend.cors').setLevel(logging.CRITICAL)

        # example test values
        cls.backend = frontend.app.backend
        cls.dataRepo = cls.backend.getDataRepository()
        cls.referenceSet = cls.dataRepo.getReferenceSets()[0]
        cls.referenceSetId = cls.referenceSet.getId()
        cls.reference = cls.referenceSet.getReferences()[0]
        cls.referenceId = cls.reference.getId()
        cls.dataset = cls.backend.getDataRepository().getDatasets()[0]
        cls.datasetId = cls.dataset.getId()
        cls.variantSet = cls.dataset.getVariantSets()[0]
        cls.variantSetId = cls.variantSet.getId()
        gaVariant = cls.variantSet.getVariants("1", 0, 2**32).next()
        cls.variantId = gaVariant.id
        cls.callSet = cls.variantSet.getCallSets()[0]
        cls.callSetId = cls.callSet.getId()
        cls.readGroupSet = cls.dataset.getReadGroupSets()[0]
        cls.readGroupSetId = cls.readGroupSet.getId()
        cls.readGroup = cls.readGroupSet.getReadGroups()[0]
        cls.readGroupId = cls.readGroup.getId()
        cls.readAlignment = cls.readGroup.getReadAlignments().next()
        cls.readAlignmentId = cls.readAlignment.id
        cls.phenotypeAssociationSet = \
            cls.dataset.getPhenotypeAssociationSets()[0]
        cls.phenotypeAssociationSetId = cls.phenotypeAssociationSet.getId()
        cls.association = cls.phenotypeAssociationSet.getAssociations()[0]
        cls.phenotype = cls.association.phenotype
        cls.phenotypeId = cls.phenotype.id
        cls.featureSets = cls.dataset.getFeatureSets()
        cls.genotypePhenotype = cls.phenotypeAssociationSet.getAssociations(
            request=None, featureSets=cls.featureSets)[0]
        cls.genotypePhenotypeId = cls.genotypePhenotype.id
        cls.rnaQuantificationSet = cls.dataset.getRnaQuantificationSets()[0]
        cls.rnaQuantificationSetId = cls.rnaQuantificationSet.getId()
        cls.rnaQuantification = cls.rnaQuantificationSet.getRnaQuantifications(
            )[0]
        cls.rnaQuantificationId = cls.rnaQuantification.getId()
        cls.expressionLevel = cls.rnaQuantification.getExpressionLevels(
            1, 2)[0]
        cls.expressionLevelId = cls.expressionLevel.getId()
示例#4
0
    def setUpClass(cls):
        config = {
            "DATA_SOURCE": "simulated://",
            "SIMULATED_BACKEND_RANDOM_SEED": 1111,
            "SIMULATED_BACKEND_NUM_CALLS": 1,
            "SIMULATED_BACKEND_VARIANT_DENSITY": 1.0,
            "SIMULATED_BACKEND_NUM_VARIANT_SETS": 1,
            "LANDING_MESSAGE_HTML": paths.landingMessageHtml
            # "DEBUG" : True
        }
        frontend.reset()
        frontend.configure(
            baseConfig="TestConfig", extraConfig=config)
        cls.app = frontend.app.test_client()
        # silence usually unhelpful CORS log
        logging.getLogger('ga4gh.frontend.cors').setLevel(logging.CRITICAL)

        # example test values
        cls.backend = frontend.app.backend
        cls.dataRepo = cls.backend.getDataRepository()
        cls.referenceSet = cls.dataRepo.getReferenceSets()[0]
        cls.referenceSetId = cls.referenceSet.getId()
        cls.reference = cls.referenceSet.getReferences()[0]
        cls.referenceId = cls.reference.getId()
        cls.dataset = cls.backend.getDataRepository().getDatasets()[0]
        cls.datasetId = cls.dataset.getId()
        cls.variantSet = cls.dataset.getVariantSets()[0]
        cls.variantSetId = cls.variantSet.getId()
        gaVariant = cls.variantSet.getVariants("1", 0, 2**32).next()
        cls.variantId = gaVariant.id
        cls.callSet = cls.variantSet.getCallSets()[0]
        cls.callSetId = cls.callSet.getId()
        cls.readGroupSet = cls.dataset.getReadGroupSets()[0]
        cls.readGroupSetId = cls.readGroupSet.getId()
        cls.readGroup = cls.readGroupSet.getReadGroups()[0]
        cls.readGroupId = cls.readGroup.getId()
        cls.readAlignment = cls.readGroup.getReadAlignments().next()
        cls.readAlignmentId = cls.readAlignment.id
        cls.phenotypeAssociationSet = \
            cls.dataset.getPhenotypeAssociationSets()[0]
        cls.phenotypeAssociationSetId = cls.phenotypeAssociationSet.getId()
        cls.association = cls.phenotypeAssociationSet.getAssociations()[0]
        cls.phenotype = cls.association.phenotype
        cls.phenotypeId = cls.phenotype.id
        cls.featureSets = cls.dataset.getFeatureSets()
        cls.genotypePhenotype = cls.phenotypeAssociationSet.getAssociations(
            request=None, featureSets=cls.featureSets)[0]
        cls.genotypePhenotypeId = cls.genotypePhenotype.id
        cls.rnaQuantificationSet = cls.dataset.getRnaQuantificationSets()[0]
        cls.rnaQuantificationSetId = cls.rnaQuantificationSet.getId()
        cls.rnaQuantification = cls.rnaQuantificationSet.getRnaQuantifications(
            )[0]
        cls.rnaQuantificationId = cls.rnaQuantification.getId()
        cls.expressionLevel = cls.rnaQuantification.getExpressionLevels(
            1, 2)[0]
        cls.expressionLevelId = cls.expressionLevel.getId()
示例#5
0
 def setUpClass(cls):
     config = {
         "DATA_SOURCE": paths.testDataRepo,
         "DEBUG": False
     }
     logging.getLogger('ga4gh.frontend.cors').setLevel(logging.CRITICAL)
     frontend.reset()
     frontend.configure(
         baseConfig="TestConfig", extraConfig=config)
     cls.app = frontend.app.test_client()
示例#6
0
 def setUpClass(cls):
     config = {
         "DATA_SOURCE": "simulated://",
         "SIMULATED_BACKEND_RANDOM_SEED": 1111,
         "SIMULATED_BACKEND_NUM_CALLS": 1,
         "SIMULATED_BACKEND_VARIANT_DENSITY": 1.0,
         "SIMULATED_BACKEND_NUM_VARIANT_SETS": 1,
         "CACHE_DIRECTORY": "/tmp/ga4gh-test"
     }
     frontend.reset()
     frontend.configure(baseConfig="TestAuth0Config", extraConfig=config)
     cls.app = frontend.app
     # silence usually unhelpful CORS log
     logging.getLogger('ga4gh.frontend.cors').setLevel(logging.CRITICAL)
     cls.backend = frontend.app.backend
     cls.client = frontend.app.test_client()
示例#7
0
 def setUpClass(cls):
     config = {
         "SIMULATED_BACKEND_RANDOM_SEED": 1111,
         "SIMULATED_BACKEND_NUM_CALLS": 1,
         "SIMULATED_BACKEND_VARIANT_DENSITY": 1.0,
         "SIMULATED_BACKEND_NUM_VARIANT_SETS": 1,
         "DATA_SOURCE": "simulated://",
         "OIDC_CLIENT_ID": "123",
         "OIDC_CLIENT_SECRET": RANDSTR,
         "OIDC_PROVIDER": "http://auth.com",
         "SECRET_KEY": "secret"
         # "DEBUG" : True
     }
     frontend.reset()
     frontend.configure(
         baseConfig="TestOidcConfig", extraConfig=config, port=8001)
     cls.app = frontend.app.test_client()
示例#8
0
文件: test_oidc.py 项目: ga4gh/server
 def setUpClass(cls):
     config = {
         "SIMULATED_BACKEND_RANDOM_SEED": 1111,
         "SIMULATED_BACKEND_NUM_CALLS": 1,
         "SIMULATED_BACKEND_VARIANT_DENSITY": 1.0,
         "SIMULATED_BACKEND_NUM_VARIANT_SETS": 1,
         "DATA_SOURCE": "simulated://",
         "OIDC_CLIENT_ID": "123",
         "OIDC_CLIENT_SECRET": RANDSTR,
         "OIDC_PROVIDER": "https://accounts.example.com",
         "SECRET_KEY": "secret"
         # "DEBUG" : True
     }
     shutil.rmtree('/tmp/ga4gh', True)
     frontend.reset()
     frontend.configure(
         baseConfig="TestOidcConfig", extraConfig=config, port=8001)
     cls.app = frontend.app.test_client()
 def setUpClass(cls):
     frontend.reset()
     frontend.configure(baseConfig="TestConfig")
     cls.app = frontend.app.test_client()
示例#10
0
 def tearDownClass(cls):
     shutil.rmtree('/tmp/ga4gh-test', True)
     frontend.reset()
示例#11
0
 def setUpClass(cls):
     frontend.reset()
     frontend.configure(baseConfig="TestConfig")
     cls.app = frontend.app.test_client()
示例#12
0
 def setUpClass(cls):
     frontend.reset()
     frontend.configure(baseConfig="TestConfig")
     frontend.app.log_exception = mock.Mock()
示例#13
0
 def setUpClass(cls):
     frontend.reset()
     frontend.configure(baseConfig="TestConfig")
     frontend.app.log_exception = mock.Mock()