mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 22:23:11 +02:00
37 lines
686 B
Python
37 lines
686 B
Python
|
|
"""
|
||
|
|
Tests tabular_parameters function
|
||
|
|
"""
|
||
|
|
|
||
|
|
from code.main import tabular_parameters
|
||
|
|
|
||
|
|
def given_empty_then_empty():
|
||
|
|
"""
|
||
|
|
Given:
|
||
|
|
When: N/A
|
||
|
|
Then: <!DOCTYPE html><html>
|
||
|
|
"""
|
||
|
|
assert tabular_parameters("") == ""
|
||
|
|
|
||
|
|
def given_empty_brackets_then_empty():
|
||
|
|
"""
|
||
|
|
Given: []
|
||
|
|
When: N/A
|
||
|
|
Then: <!DOCTYPE html><html>
|
||
|
|
"""
|
||
|
|
assert tabular_parameters("[]") == ""
|
||
|
|
|
||
|
|
def given_non_empty_then_error():
|
||
|
|
"""
|
||
|
|
Given: [c]
|
||
|
|
When: N/A
|
||
|
|
Then: <!DOCTYPE html><html>
|
||
|
|
"""
|
||
|
|
assert tabular_parameters("[c]") == "Error!"
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
def test_tabular_parameters():
|
||
|
|
given_empty_then_empty()
|
||
|
|
given_empty_brackets_then_empty()
|
||
|
|
given_non_empty_then_error()
|