Exemplo n.º 1
0
    def test_deprecated_msg_param(self):
        with warnings.catch_warnings(record=True) as w:
            assertions.assert_is(None, None, msg="This is a message")

            assertions.assert_equal(len(w), 1)
            assert issubclass(w[-1].category, DeprecationWarning)
            assertions.assert_in("msg is deprecated", str(w[-1].message))
Exemplo n.º 2
0
    def test_deprecated_msg_param(self):
        with warnings.catch_warnings(record=True) as w:
            assertions.assert_is(None, None, msg="This is a message")

            assertions.assert_equal(len(w), 1)
            assert issubclass(w[-1].category, DeprecationWarning)
            assertions.assert_in("msg is deprecated", str(w[-1].message))
Exemplo n.º 3
0
    def test_message_param_not_deprecated(self):
        with warnings.catch_warnings(record=True) as w:
            assertions.assert_is(None, None, message="This is a message")

            assertions.assert_equal(len(w), 0)
Exemplo n.º 4
0
 def test_cheap_copy(self):
     fd = fdict()
     T.assert_is(fd, fd.copy())
Exemplo n.º 5
0
    def test_message_param_not_deprecated(self):
        with warnings.catch_warnings(record=True) as w:
            assertions.assert_is(None, None, message="This is a message")

            assertions.assert_equal(len(w), 0)
Exemplo n.º 6
0
    def test_build_existing(self):
        value_proxy = self.factory.build(*self.args)
        self.mock_register.reset_mock()

        assert_is(value_proxy, self.factory.build(*self.args))
        assert not self.mock_register.mock_calls