def test_prefixed_attributes_are_stored_on_the_object(self):
        obj = TwitchObject()
        value = 'spongebob'
        obj._spongebob = value

        obj._spongebob
        getattr(obj, '_spongebob')
        assert 'spongebob' not in obj
        assert '_spongebob' not in obj
        assert '_spongebob' in obj.__dict__
        assert obj._spongebob == value

        del obj._spongebob

        assert 'spongebob' not in obj
        assert 'spongebob' not in obj.__dict__
Exemplo n.º 2
0
    def test_prefixed_attributes_are_stored_on_the_object(self):
        obj = TwitchObject()
        value = "spongebob"
        obj._spongebob = value

        obj._spongebob
        getattr(obj, "_spongebob")
        assert "spongebob" not in obj
        assert "_spongebob" not in obj
        assert "_spongebob" in obj.__dict__
        assert obj._spongebob == value

        del obj._spongebob

        assert "spongebob" not in obj
        assert "spongebob" not in obj.__dict__