Completed
Pull Request — master (#138)
by
unknown
20:13
created

SessionStorage   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 70%
Metric Value
dl 0
loc 19
ccs 7
cts 10
cp 0.7
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __delitem__() 0 2 1
A get() 0 2 1
A delete() 0 2 1
A __getitem__() 0 2 1
A __setitem__() 0 2 1
A set() 0 2 1
1
# -*- coding: utf-8 -*-
2 10
from __future__ import absolute_import, unicode_literals
3
4
5 10
class SessionStorage(object):
6
7 10
    def get(self, key, default=None):
8
        raise NotImplementedError()
9
10 10
    def set(self, key, value, ttl=None):
11
        raise NotImplementedError()
12
13 10
    def delete(self, key):
14
        raise NotImplementedError()
15
16 10
    def __getitem__(self, key):
17
        self.get(key)
18
19 10
    def __setitem__(self, key, value):
20
        self.set(key, value)
21
22 10
    def __delitem__(self, key):
23
        self.delete(key)
24