Ejemplo n.º 1
0
    def test_attributes_are_stored_and_fetched_from_dict(self):
        obj = TwitchObject()
        value = 'spongebob'
        obj.spongebob = value

        assert 'spongebob' in obj
        assert '_spongebob' not in obj.__dict__
        assert 'spongebob' not in obj.__dict__
        assert obj['spongebob'] == value
        assert obj.spongebob == value

        del obj.spongebob

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

        assert "spongebob" in obj
        assert "_spongebob" not in obj.__dict__
        assert "spongebob" not in obj.__dict__
        assert obj["spongebob"] == value
        assert obj.spongebob == value

        del obj.spongebob

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