Пример #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
Пример #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
Пример #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
Пример #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
Пример #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
Пример #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
Пример #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)
Пример #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)
Пример #9
0
    def test_initialize(self):
        expect_object = Expect(self.data)

        self.assertEqual(expect_object.actual_data, self.data)
        self.assertFalse(expect_object.negate)
Пример #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'})
Пример #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')
Пример #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)
Пример #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'})
Пример #14
0
    def test_not(self):
        expect_object = Expect(self.data).not_()

        self.assertTrue(expect_object.negate)