コード例 #1
0
 def test_all_valid_examples_succeed(self):
     for v in get_valid_examples():
         self.assertTrue(is_valid_resource(v))
         validate_resource(v)
コード例 #2
0
 def test_valid_and_invalid_examples_are_not_the_same(self):
     for v in get_valid_examples():
         for i in get_invalid_examples():
             self.assertNotEqual(v, i,
                                 "A valid example can not be invalid.")
コード例 #3
0
from schul_cloud_resources_api_v1.schema import get_valid_examples
from schul_cloud_resources_api_v1 import ApiClient, ResourceApi
from schul_cloud_resources_server_tests.app import run as run_test_server_app
from schul_cloud_resources_server_tests.tests.fixtures import *
from schul_cloud_url_crawler import ResourceClient, CrawledResource
import time
import requests
from unittest.mock import Mock
from collections import namedtuple

# configuration
NUMBER_OF_VALID_RESOURCES = 3
STARTUP_TIMEOUT = 2  # seconds

# module constants
VALID_RESOURCES = get_valid_examples()


@pytest.fixture(scope="session")
def host():
    """The host of the application."""
    return "localhost"


@pytest.fixture(scope="session")
def _server():
    """The server to start the app."""
    return StoppableWSGIRefServerAdapter()


@pytest.fixture(scope="session")
コード例 #4
0
 def test_there_are_valid_examples(self):
     self.assertTrue(get_valid_examples())
コード例 #5
0
def valid_resources():
    """Return a list of valid ressoruces useable by tests."""
    return get_valid_examples()