Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sup2point0 authored Apr 3, 2024
1 parent c690721 commit fd6bb9d
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions tests/quarkify.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from quarkdown import quarkify


def test_positive():
def test_live_positive():
result = quarkify.extract_quarks('''
<!-- #QUARK live! -->
<!-- #QUARK
Expand All @@ -17,15 +17,48 @@ def test_positive():
assert result["path"] == "testing/test", "export path incorrect!"


def test_negative():
def test_live_negative():
skips = False

try:
quarkify.extract_quarks('''
testing
<!-- #QUARK -->
''')
except quarkify.Quarkless:
skips = True

assert skips


def test_dead():
skips = False

try:
quarkify.extract_quarks('''
<!-- #QUARK dead! -->
<!-- #QUARK live! -->
''')
except quarkify.Quarkless:
skips = True

assert skips


def test_data_single():
result = quarkify.extract_quarks('''
<!-- #QUARK live! -->
<!-- #QUARK
EXPORT: testing/test
STYLE: default
DUALITY: light
INDEX: tests
DATE: 24
-->
''')

assert result["live"] is True
assert result["path"] == "testing/test"
assert result["style"] == "default"
assert result["duality"] == "light"
assert result["index"] == "tests"
assert result["date"] = 24

0 comments on commit fd6bb9d

Please sign in to comment.