add test files

parent 11199458
if ($test_redirect) {
rewrite ^/test/(.*)$ $test_redirect break;
}
if ($test_rewrite_redirect) {
rewrite ^/test/(.*)$ $test_rewrite_redirect break;
return rewrite;
}
if ($test_status=301_redirect) {
rewrite ^/test/(.*)$ $test_status=301_redirect break;
return status=301;
}
if ($test_permanent_redirect) {
rewrite ^/test/(.*)$ $test_permanent_redirect permanent;
}
map $uri $test_redirect {
/test/some-page /test/another-page;
/test/old-page /test/new-page;
/test/very-old-page /test/very-new-page;
~/test^assets/(.+) /test/new-assets/$1;
/test/some-page /other-project/some-page;
}
\ No newline at end of file
map $uri $test_permanent_redirect {
/test/special-project https://github.com/etersoft/special-project;
}
\ No newline at end of file
map $uri $test_rewrite_redirect {
/test/categories /test/categories;
}
\ No newline at end of file
map $uri $test_status=301_redirect {
/test/article-123.html /test/articles/123;
}
\ No newline at end of file
import unittest
from redirector.tests.utils import get_abs_path
from redirector.conf.config import Config
from redirector.redirector import *
......@@ -9,6 +11,11 @@ class EqualRedirectorTest(unittest.TestCase):
self.redirector = Redirector()
def test_equal_map(self):
config = Config()
abs_config_path = get_abs_path('test.ini')
config.read_config(abs_config_path)
abs_yaml_path = get_abs_path('test.yaml')
abs_test_path = get_abs_path('test.map')
[DEFAULT]
nginx_dir = '/home/kantegory/pvt/nginx-redirector/tests/nginx'
maps_dir = %(nginx_dir)s/maps
config_dir = %(nginx_dir)s/location-includes
......@@ -21,6 +21,12 @@ classifiers_list = [
setup(
name=const.NAME,
version="0.1.1",
description="CLI-utility for building nginx redirects",
long_description=open('README.md').read(),
author="Nikita Efremov, Dobryakov David",
author_email="kantegory@etersoft.ru",
url="https://gitlab.eterfund.ru/eterfund/nginx-redirector/tree/dev-enhancement",
license="ISC",
packages=['redirector', 'redirector.utils', 'redirector.tests', 'redirector.conf'],
entry_points={
'console_scripts': [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment