26 lines
761 B
Python
26 lines
761 B
Python
import os
|
|
import pytest
|
|
|
|
import wcs.qommon.ctl
|
|
from wcs.ctl.collectstatic import CmdCollectStatic
|
|
|
|
from utilities import create_temporary_pub, clean_temporary_pub
|
|
|
|
@pytest.fixture
|
|
def pub():
|
|
return create_temporary_pub()
|
|
|
|
def teardown_module(module):
|
|
clean_temporary_pub()
|
|
|
|
def test_loading():
|
|
ctl = wcs.qommon.ctl.Ctl(cmd_prefixes=['wcs.ctl'])
|
|
ctl.load_all_commands(ignore_errors=False)
|
|
assert 'start' in ctl.get_commands().keys()
|
|
|
|
def test_collectstatic(pub):
|
|
CmdCollectStatic.collectstatic(pub)
|
|
assert os.path.exists(os.path.join(pub.app_dir, 'collectstatic', 'css', 'wcs.css'))
|
|
CmdCollectStatic.collectstatic(pub, clear=True, link=True)
|
|
assert os.path.islink(os.path.join(pub.app_dir, 'collectstatic', 'css', 'wcs.css'))
|