Skip to content

Commit

Permalink
test override styles
Browse files Browse the repository at this point in the history
  • Loading branch information
humrochagf committed Feb 5, 2019
1 parent ae035fa commit fcad381
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,32 @@ def test_mkstatic(self):
self.assertTrue(os.path.isfile(index_file))
self.assertTrue(os.path.isdir(static_folder))

def test_mkstatic_override_styles(self):
base_folder = tempfile.mkdtemp(dir=self.tests_folder)
_, presentation_file = tempfile.mkstemp(
".md", "slides", base_folder, "# Test\n"
)
_, style_file = tempfile.mkstemp(
".css", base_folder, "h1 { color: #000 }"
)
output_folder = os.path.join(base_folder, "output")
index_file = os.path.join(output_folder, "index.html")
output_style_file = os.path.join(output_folder, style_file)
static_folder = os.path.join(output_folder, "static")

runner = CliRunner()
result = runner.invoke(
cli.mkstatic, [
presentation_file, "-o", output_folder, "-s", style_file
]
)

self.assertEqual(result.exit_code, 0)
self.assertTrue(os.path.isdir(output_folder))
self.assertTrue(os.path.isfile(index_file))
self.assertTrue(os.path.isfile(output_style_file))
self.assertTrue(os.path.isdir(static_folder))

def test_mkstatic_output_already_exists_file(self):
base_folder = tempfile.mkdtemp(dir=self.tests_folder)
_, presentation_file = tempfile.mkstemp(
Expand Down

0 comments on commit fcad381

Please sign in to comment.