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"""