Skip to content

Commit

Permalink
Fix some typos and name-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
drgarcia1986 committed Aug 12, 2020
1 parent 3ed3107 commit 81b40b4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion shared_memory_dict/caches/aiocache.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(
):
super().__init__(**kwargs)
self.serializer = serializer or NullSerializer()
self._cache = SharedMemoryDict(f'c_{name}', size)
self._cache = SharedMemoryDict(name, size)
self._handlers: Dict[str, TimerHandle] = {}

@classmethod
Expand Down
4 changes: 1 addition & 3 deletions shared_memory_dict/caches/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def __init__(self, name: str, params: Dict) -> None:
options = params.get('OPTIONS', {})
self._cache = _caches.get(
name,
SharedMemoryDict(
f'c_{name}', options.get('MEMORY_BLOCK_SIZE', 1024)
),
SharedMemoryDict(name, options.get('MEMORY_BLOCK_SIZE', 1024)),
)

def add(
Expand Down
2 changes: 1 addition & 1 deletion shared_memory_dict/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .templates import MEMORY_NAME


def create_shared_memmory(name: str, size: int) -> None:
def create_shared_memory(name: str, size: int) -> None:
SharedMemory(MEMORY_NAME.format(name=name), create=True, size=size)


Expand Down
4 changes: 2 additions & 2 deletions tests/test_hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest.mock import patch

from shared_memory_dict.hooks import create_shared_memmory, free_shared_memory
from shared_memory_dict.hooks import create_shared_memory, free_shared_memory
from shared_memory_dict.templates import MEMORY_NAME


Expand All @@ -11,7 +11,7 @@ def test_should_create_shared_memory(self):
expected_size = 64

with patch('shared_memory_dict.hooks.SharedMemory') as mock:
create_shared_memmory(expected_name, expected_size)
create_shared_memory(expected_name, expected_size)

mock.assert_called_once_with(
MEMORY_NAME.format(name=expected_name),
Expand Down

0 comments on commit 81b40b4

Please sign in to comment.