Skip to content

Commit 7fee586

Browse files
committed
Add non empty string tests
#2
1 parent 7eb5f9e commit 7fee586

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import unittest
2+
3+
from pyvalueobjects.errors.ValueObjectError import ValueObjectError
4+
from pyvalueobjects.strings.non_empty_string import NonEmptyString
5+
6+
7+
class TestNonemptyStringValueObject(unittest.TestCase):
8+
def test_value_return_input_value(self):
9+
self.assertRaises(ValueObjectError, NonEmptyString, '')
10+
11+
def test_basic_string(self):
12+
vo = NonEmptyString('patata')
13+
self.assertEqual('patata', vo.value())
14+
15+
def test_none_return_none(self):
16+
self.assertRaises(ValueObjectError, NonEmptyString, None)

0 commit comments

Comments
 (0)