#23 Add tests for caching

This commit is contained in:
Felix committed 2018-12-18 15:33:26 +01:00
1 parent 178d8036c2
commit b3815b6b98
6 files changed
+165 -1

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
# Copyright 2018 3YOURMIND GmbH
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from pathlib import Path
from appdirs import user_cache_dir
__VERSION__ = '0.0.7'
DEFAULT_CACHE_PATH = Path(user_cache_dir("django-migration-linter", version=__VERSION__))
+6
View File
@@ -16,6 +16,8 @@ from __future__ import print_function
import os
import sys
from django_migration_linter.constants import DEFAULT_CACHE_PATH
def is_django_project(path):
django_manage_file = os.path.join(path, 'manage.py')
@@ -54,3 +56,7 @@ def split_path(path):
def clean_bytes_to_str(byte_input):
return byte_input.decode('utf-8').strip()
def get_default_cache_file(project_name):
os.join(DEFAULT_CACHE_PATH, '{0}.pickle'.format(project_name))