|
 |
c907d1d |
import os
|
|
 |
c907d1d |
|
|
 |
c907d1d |
from pytest import fixture
|
|
 |
c907d1d |
from sphinx_kr_theme import get_html_theme_path
|
|
 |
c907d1d |
|
|
 |
c907d1d |
|
|
 |
c907d1d |
@fixture
|
|
 |
c907d1d |
def html_theme_path():
|
|
 |
c907d1d |
return get_html_theme_path()
|
|
 |
c907d1d |
|
|
 |
c907d1d |
|
|
 |
c907d1d |
def test_path(html_theme_path):
|
|
 |
c907d1d |
assert html_theme_path.endswith('sphinx_kr_theme')
|
|
 |
c907d1d |
assert {'kr', 'kr_small'}.issubset(set(os.listdir(html_theme_path)))
|
|
 |
c907d1d |
|
|
 |
c907d1d |
|
|
 |
c907d1d |
def test_files(html_theme_path):
|
|
 |
c907d1d |
kr_files = set(os.listdir(os.path.join(html_theme_path, 'kr')))
|
|
 |
c907d1d |
kr_small_files = set(os.listdir(os.path.join(html_theme_path, 'kr_small')))
|
|
 |
c907d1d |
required_files = {'static', 'layout.html', 'theme.conf'}
|
|
 |
c907d1d |
|
|
 |
c907d1d |
assert required_files.issubset(kr_files)
|
|
 |
c907d1d |
assert required_files.issubset(kr_small_files)
|
|
 |
c907d1d |
|
|
 |
c907d1d |
|
|
 |
c907d1d |
def test_static_files():
|
|
 |
c907d1d |
kr_static = os.path.join(get_html_theme_path(), 'kr/static')
|
|
 |
c907d1d |
kr_small_static = os.path.join(get_html_theme_path(), 'kr_small/static')
|
|
 |
c907d1d |
|
|
 |
c907d1d |
kr_static_files = map(os.path.splitext, os.listdir(kr_static))
|
|
 |
c907d1d |
kr_small_static_files = map(os.path.splitext, os.listdir(kr_small_static))
|
|
 |
c907d1d |
|
|
 |
c907d1d |
kr_static_exts = {ext for _, ext in kr_static_files}
|
|
 |
c907d1d |
kr_small_static_exts = {ext for _, ext in kr_small_static_files}
|
|
 |
c907d1d |
|
|
 |
c907d1d |
assert kr_static_exts == {'.css', '.css_t'}
|
|
 |
c907d1d |
assert kr_small_static_exts == {'.css_t'}
|