From 979e04a16c82bf08749654a157e2ebe1ca1c1e69 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sun, 20 Jul 2014 23:35:28 +0200 Subject: [PATCH] More tests. --- tests/test_utils.py | 7 +++++++ tests/test_video.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/tests/test_utils.py b/tests/test_utils.py index 3d0227f..efda91a 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -38,6 +38,13 @@ def test_url_from_path(): assert utils.url_from_path(os.sep.join(['foo', 'bar'])) == 'foo/bar' +def test_url_from_windows_path(monkeypatch): + monkeypatch.setattr('os.sep', "\\") + path = os.sep.join(['foo', 'bar']) + assert path == r'foo\bar' + assert utils.url_from_path(path) == 'foo/bar' + + def test_read_markdown(): src = os.path.join(SAMPLE_DIR, 'pictures', 'dir1', 'test1', '11.md') m = utils.read_markdown(src) diff --git a/tests/test_video.py b/tests/test_video.py index 4937cda..a53346e 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -11,6 +11,11 @@ TEST_VIDEO = 'stallman software-freedom-day-low.ogv' SRCFILE = os.path.join(CURRENT_DIR, 'sample', 'pictures', 'video', TEST_VIDEO) +def test_video_size(): + size_src = video_size(SRCFILE) + assert size_src == (480, 270) + + def test_generate_video_fit_height(tmpdir): """largest fitting dimension is height"""