Welcome to mirror list, hosted at ThFree Co, Russian Federation.

either_tests.py « tests « types « core « pypeline « src - github.com/ianj-als/pypeline.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8f59f91f01caa4b9b8d714e6133d97d39e9b2fcb (plain)
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
#
# Copyright Applied Language Solutions 2012
#
# This file is part of Pypeline.
#
# Pypeline is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pypeline is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pypeline.  If not, see <http://www.gnu.org/licenses/>.
#
import unittest

from pypeline.core.types.either import Either, Left, Right


class EitherUnitTests(unittest.TestCase):
    def test_eq(self):
        self.assertEquals(Left(10), Left(10))
        self.assertEquals(Right("something"), Right("something"))


    def test_ne(self):
        self.assertNotEquals(Left(10), Left(11))
        self.assertNotEquals(Left(10), Right(10))