forked from benevolentprof/inf1340_2015_asst2
/
test_exercise1.py
36 lines (23 loc) · 1.1 KB
/
test_exercise1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
""" Assignment 2, Exercise 1, INF1340, Fall, 2015. Pig Latin
Test module for exercise1.py
"""
__author__ = 'Susan Sim'
__email__ = "ses@drsusansim.org"
__copyright__ = "2015 Susan Sim"
__license__ = "MIT License"
from exercise1 import pig_latinify
def test_basic():
assert pig_latinify("dog") == "ogday"
assert pig_latinify("scratch") == "atchscray"
assert pig_latinify("is") == "isyay"
assert pig_latinify("apple") == "appleyay"
def test_advanced():
assert pig_latinify("BILLY") == "illybay"
assert pig_latinify("asdfghhjkloiytffv") == "asdfghhjkloiytffvyay"
assert pig_latinify("phlegm") == "egmphlay"
def test_errors():
assert pig_latinify(1234) == "Error! Please only enter characters between A-Z. Please enter a word:"
assert pig_latinify("Elly-May") == "Error! Please only enter characters between A-Z. Please enter a word:"
assert pig_latinify("Winston Churchill") == "Error! Please only enter characters between A-Z. Please enter a word:"
assert pig_latinify("Ke$ha") == "Error! Please only enter characters between A-Z. Please enter a word:"