def test_generate_css_creates_output_folder(): here = Path(__file__).parent fixture_input = here / 'fixtures' / 'css' / 'sass' fixture_output = here / 'fixtures' / 'css' / 'css' if fixture_output.exists(): rmtree(str(fixture_output)) assert not fixture_output.exists() generate_css(fixture_input, fixture_output) assert fixture_output.exists()
def test_generate_css_output_folder_exists(): """ If the output folder already exists, the code should use it. """ here = Path(__file__).parent fixture_input = here / 'fixtures' / 'css' / 'sass' fixture_output = here / 'fixtures' / 'css' / 'css' if not fixture_output.exists(): fixture_output.mkdir(parents=True) assert fixture_output.exists() generate_css(fixture_input, fixture_output) assert fixture_output.exists()
def test_generate_css(tmpdir): here = Path(__file__).parent fixture_input = here / 'fixtures' / 'css' / 'sass' fixture_output = Path(str(tmpdir)) mapping = generate_css(fixture_input, fixture_output) assert (fixture_output / 'style.cf83e135.css').exists() assert mapping == {'style.scss': 'style.cf83e135.css'}