Total Complexity | 5 |
Total Lines | 15 |
Duplicated Lines | 0 % |
Coverage | 90.91% |
1 | # -*- coding: utf-8 -*- |
||
6 | 10 | class MemoryStorage(SessionStorage): |
|
7 | |||
8 | 10 | def __init__(self): |
|
9 | 10 | self._data = {} |
|
10 | |||
11 | 10 | def get(self, key, default=None): |
|
12 | 10 | return self._data.get(key, default) |
|
13 | |||
14 | 10 | def set(self, key, value, ttl=None): |
|
15 | 10 | if value is None: |
|
16 | 10 | return |
|
17 | 10 | self._data[key] = value |
|
18 | |||
19 | 10 | def delete(self, key): |
|
20 | self._data.pop(key, None) |
||
21 |