Exemplo n.º 1
0
    def test_successful_to_be_less_than(self):
        expect_object = Expect(10)
        expect_object.negate = False

        try:
            expect_object.to_be_less_than(15)
        except ExpectationException:
            raise AssertionError
Exemplo n.º 2
0
    def test_successful_not_to_equal(self):
        expect_object = Expect(self.data)
        expect_object.negate = True

        try:
            expect_object.to_equal('foo')
        except ExpectationException:
            raise AssertionError
Exemplo n.º 3
0
    def test_successful_to_equal_call(self):
        expect_object = Expect(self.data)
        expect_object.negate = False

        try:
            expect_object.to_equal({'foo': 'bar'})
        except ExpectationException:
            raise AssertionError
Exemplo n.º 4
0
    def test_successful_not_to_be_call(self):
        expect_object = Expect(self.data)
        expect_object.negate = True

        try:
            expect_object.to_be({'foo': 'bar'})
        except ExpectationException:
            raise AssertionError
Exemplo n.º 5
0
    def test_successful_not_to_be_greater_than_or_equal_to(self):
        expect_object = Expect(10)
        expect_object.negate = True

        try:
            expect_object.to_be_greater_than_or_equal_to(11)
        except ExpectationException:
            raise AssertionError
Exemplo n.º 6
0
    def test_successful_to_be(self):
        expect_object = Expect(self.data)
        expect_object.negate = False

        try:
            expect_object.to_be(self.data)
        except ExpectationException:
            raise AssertionError
Exemplo n.º 7
0
    def test_failure_not_to_be_greater_than_or_equal_to(self):
        expect_object = Expect(10)
        expect_object.negate = True

        with self.assertRaises(ExpectationException):
            expect_object.to_be_greater_than_or_equal_to(5)

        with self.assertRaises(ExpectationException):
            expect_object.to_be_greater_than_or_equal_to(10)
Exemplo n.º 8
0
    def test_failure_to_be_less_than(self):
        expect_object = Expect(10)
        expect_object.negate = False

        with self.assertRaises(ExpectationException):
            expect_object.to_be_less_than(5)
Exemplo n.º 9
0
    def test_initialize(self):
        expect_object = Expect(self.data)

        self.assertEqual(expect_object.actual_data, self.data)
        self.assertFalse(expect_object.negate)
Exemplo n.º 10
0
    def test_failure_not_to_equal(self):
        expect_object = Expect(self.data)
        expect_object.negate = True

        with self.assertRaises(ExpectationException):
            expect_object.to_equal({'foo': 'bar'})
Exemplo n.º 11
0
    def test_failure_to_equal_call(self):
        expect_object = Expect(self.data)
        expect_object.negate = False

        with self.assertRaises(ExpectationException):
            expect_object.to_equal('foo')
Exemplo n.º 12
0
    def test_failure_not_to_be_call(self):
        expect_object = Expect(self.data)
        expect_object.negate = True

        with self.assertRaises(ExpectationException):
            expect_object.to_be(self.data)
Exemplo n.º 13
0
    def test_failure_to_be_call(self):
        expect_object = Expect(self.data)
        expect_object.negate = False

        with self.assertRaises(ExpectationException):
            expect_object.to_be({'foo': 'bar'})
Exemplo n.º 14
0
    def test_not(self):
        expect_object = Expect(self.data).not_()

        self.assertTrue(expect_object.negate)