-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathtest_zoomba_error.py
27 lines (20 loc) · 1.12 KB
/
test_zoomba_error.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
# """Unit tests for GUILibrary keywords"""
import unittest
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src/')))
from Zoomba import ZoombaError
class TestInternal(unittest.TestCase):
def test_create_zoomba_error(self):
err = ZoombaError("description", "key", "expected", "actual")
assert f"{err}" == "Error: description\n------------------\nKey: key\nExpected: expected\nActual: actual"
def test_create_zoomba_error_by_keyword(self):
err = ZoombaError(expected="expected", actual="actual", error="description", key="key")
assert f"{err}" == "Error: description\n------------------\nKey: key\nExpected: expected\nActual: actual"
def test_create_zoomba_error_with_kwargs(self):
err = ZoombaError("description", "key", "expected", "actual", test="test")
assert f"{err}" == "Error: description\n------------------\nKey: key\n" \
"Expected: expected\nActual: actual\nTest: test"
def test_compare_zoomba_error_with_string(self):
err = ZoombaError("string")
assert err == "Error: string"