Test Failed
Push — master ( e8b070...b526e1 )
by Oleksandr
33:34 queued 26:33
created

tabpy.tabpy_server.handlers.upload_destination_handler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 3
eloc 16
dl 0
loc 22
ccs 7
cts 14
cp 0.5
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A UploadDestinationHandler.initialize() 0 2 1
A UploadDestinationHandler.get() 0 8 2
1 1
from tabpy.tabpy_server.app.SettingsParameters import SettingsParameters
2 1
from tabpy.tabpy_server.handlers import ManagementHandler
3 1
import os
4
from tabpy.tabpy_server.handlers.util import AuthErrorStates
5
6 1
7
_QUERY_OBJECT_STAGING_FOLDER = "staging"
8
9 1
10 1
class UploadDestinationHandler(ManagementHandler):
11
    def initialize(self, app):
12
        super(UploadDestinationHandler, self).initialize(app)
13 1
14
    def get(self):
15
        if self.should_fail_with_auth_error() != AuthErrorStates.NONE:
16
            self.fail_with_auth_error()
17
            return
18
19
        path = self.settings[SettingsParameters.StateFilePath]
20
        path = os.path.join(path, _QUERY_OBJECT_STAGING_FOLDER)
21
        self.write({"path": path})
22