Conftest
anyio_backend()
  Backend for anyio pytest plugin.
Returns:
| Type | Description | 
|---|---|
                str
           | 
          backend name.  | 
        
Source code in hestia/conftest.py
        30 31 32 33 34 35 36 37  |  | 
client(fastapi_app, anyio_backend)
  
  
      async
  
  Fixture that creates client for requesting server.
:yield: client for the app.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
fastapi_app | 
          
                FastAPI
           | 
          the application.  | 
          required | 
Source code in hestia/conftest.py
        209 210 211 212 213 214 215 216 217 218 219 220 221  |  | 
dbsession(_engine)
  
  
      async
  
  Get session to database.
Fixture that returns a SQLAlchemy session with a SAVEPOINT, and the rollback to it after the test completes.
:yields: async session.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
_engine | 
          
                AsyncEngine
           | 
          current engine.  | 
          required | 
Source code in hestia/conftest.py
        65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92  |  | 
fake_redis_pool()
  
  
      async
  
  Get instance of a fake redis.
:yield: FakeRedis instance.
Source code in hestia/conftest.py
        175 176 177 178 179 180 181 182 183 184 185 186 187 188  |  | 
fastapi_app(dbsession, fake_redis_pool, test_rmq_pool)
  Fixture for creating FastAPI app.
Returns:
| Type | Description | 
|---|---|
                FastAPI
           | 
          fastapi app with mocked dependencies.  | 
        
Source code in hestia/conftest.py
        191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206  |  | 
test_exchange(test_exchange_name, test_rmq_pool)
  
  
      async
  
  Creates test exchange.
:yield: created exchange.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
test_exchange_name | 
          
                str
           | 
          name of an exchange to create.  | 
          required | 
test_rmq_pool | 
          
                Pool[Channel]
           | 
          channel pool for rabbitmq.  | 
          required | 
Source code in hestia/conftest.py
        128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147  |  | 
test_exchange_name()
  
  
      async
  
  Name of an exchange to use in tests.
Returns:
| Type | Description | 
|---|---|
                str
           | 
          name of an exchange.  | 
        
Source code in hestia/conftest.py
        108 109 110 111 112 113 114 115  |  | 
test_queue(test_exchange, test_rmq_pool, test_routing_key)
  
  
      async
  
  Creates queue connected to exchange.
:yield: queue binded to test exchange.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
test_exchange | 
          
                AbstractExchange
           | 
          exchange to bind queue to.  | 
          required | 
test_rmq_pool | 
          
                Pool[Channel]
           | 
          channel pool for rabbitmq.  | 
          required | 
test_routing_key | 
          
                str
           | 
          routing key to use while binding.  | 
          required | 
Source code in hestia/conftest.py
        150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172  |  | 
test_rmq_pool()
  
  
      async
  
  Create rabbitMQ pool.
:yield: channel pool.
Source code in hestia/conftest.py
        95 96 97 98 99 100 101 102 103 104 105  |  | 
test_routing_key()
  
  
      async
  
  Name of routing key to use while binding test queue.
Returns:
| Type | Description | 
|---|---|
                str
           | 
          key string.  | 
        
Source code in hestia/conftest.py
        118 119 120 121 122 123 124 125  |  |