Skip to content

Commit

Permalink
Temp commit, please ammend/rebase, requires ci
Browse files Browse the repository at this point in the history
  • Loading branch information
cslzchen committed May 2, 2018
1 parent cdcdebd commit edf8ae5
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 72 deletions.
18 changes: 0 additions & 18 deletions .eslintrc.js

This file was deleted.

26 changes: 0 additions & 26 deletions mfr/extensions/md/settings.py

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ scipy==0.19.1

# Md
markdown==2.6.2
bleach==2.0.0

# Issue: certifi-2015.9.6.1 and 2015.9.6.2 fail verification (https://github.com/certifi/python-certifi/issues/26)
certifi==2015.4.28
Empty file removed tests/extensions/md/__init__.py
Empty file.
Binary file removed tests/extensions/md/files/invalid.md
Binary file not shown.
29 changes: 2 additions & 27 deletions tests/extensions/md/test_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ def test_md_file_path():
return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'files', 'test.md')


@pytest.fixture
def invalid_md_file_path():
return os.path.join(os.path.dirname(os.path.abspath(__file__)), 'files', 'invalid.md')


@pytest.fixture
def url():
return 'http://osf.io/file/test.md'
Expand Down Expand Up @@ -50,25 +45,5 @@ def test_render_md_cache_result(self, renderer):
assert renderer.cache_result is True

def test_render_md(self, test_md_file_path, assets_url, export_url):

metadata = ProviderMetadata(
'test',
'.md',
'text/plain',
'1234',
'http://wb.osf.io/file/test.md?token=1234'
)

md_renderer = MdRenderer(metadata, test_md_file_path, url, assets_url, export_url)
body = md_renderer.render()
in_body = 'The rain---not the reign---in\nSpain.\n\n<script>\nalert("Hello world");\n</script>'
assert in_body in body

# TODO: it is hard to test since rendering is performed by front-end javascript, if possible test the following:
# TODO: test bleach (python)
# TODO: test invalid/corrupted file (e.g. when bleach fails parsing the file)
# TODO: test markdown-it
# TODO: test toc
# TODO: test highlight
# TODO: test mathjax
# TODO: test sanitizer
# TODO: implement tests
pass

0 comments on commit edf8ae5

Please sign in to comment.