TestEndpoint   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 2 1
A post() 0 2 1
1
from mountapi.endpoints import AbstractEndpoint
2
from mountapi.routing import Route, Router
3
from mountapi.schema import Schema
4
5
6
class TestEndpoint(AbstractEndpoint):
7
    def get(self):
8
        return {'message': 'Test response.'}
9
10
    def post(self, name: str):
11
        return {'message': 'Hello {}.'.format(name)}
12
13
14
routes = [
15
    Route('/test', TestEndpoint),
16
]
17
18
schema = Schema(routes)
19
schema.build()
20
21
router = Router(schema=schema)
22