renamed files; implemented command_entry; wrote real test and added test file structure
This commit is contained in:
1 parent
92c7aa8934
commit
d08aff8dd1
8 files changed
+82
-27
No files matched your search
@@ -1,8 +0,0 @@
|
||||
from html_to_django import main
|
||||
from unittest import TestCase
|
||||
|
||||
|
||||
class TestTocHTMLParser(TestCase):
|
||||
def test_command_entry(self):
|
||||
main.command_entry()
|
||||
self.assertEqual(0, 0)
|
||||
File renamed without changes.
@@ -0,0 +1,22 @@
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
{% for i in items %}
|
||||
<p>
|
||||
{{ i.text }}
|
||||
</p>
|
||||
{% if i.selectable %}
|
||||
<p>
|
||||
Select Me
|
||||
</p>
|
||||
{% elif i.other %}
|
||||
<p>
|
||||
Else if
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
Else
|
||||
</p>
|
||||
<img src="{% static 'images/cool_image.png' %}"/>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,21 @@
|
||||
import os
|
||||
import filecmp
|
||||
import shutil
|
||||
from unittest import TestCase
|
||||
from html_to_django import converter
|
||||
|
||||
|
||||
class ConverterTests(TestCase):
|
||||
def test_convert_file(self):
|
||||
shutil.copytree(
|
||||
os.path.abspath("tests/test_project"),
|
||||
os.path.abspath("tests/test_project_test_result"),
|
||||
dirs_exist_ok=True
|
||||
)
|
||||
converter.convert_file(
|
||||
os.path.abspath("tests/test_project_test_result/test.html")
|
||||
)
|
||||
self.assertTrue(filecmp.cmp(
|
||||
os.path.abspath("tests/test_project_test_result/test.n.html"),
|
||||
os.path.abspath("tests/test_project_expected_result/test.n.html")
|
||||
))
|
||||
Reference in new issue
Block a user