示例#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)