コード例 #1
0
    def test_de_json_all(self, client, block_entity_data_with_type):
        data, type_ = block_entity_data_with_type

        json_dict = {'id_': self.id, 'type_': type_, 'data': data.to_dict()}
        block_entity = BlockEntity.de_json(json_dict, client)

        assert block_entity.id == self.id
        assert block_entity.type == type_
        assert block_entity.data == data
コード例 #2
0
    def test_de_json_required(self, client, block_entity_data_with_type):
        data, type = block_entity_data_with_type

        json_dict = {'id': self.id, 'type': type, 'data': data.to_dict()}
        block_entity = BlockEntity.de_json(json_dict, client)

        assert block_entity.id == self.id
        assert block_entity.type == type
        assert block_entity.data == data
コード例 #3
0
 def test_de_json_none(self, client):
     assert BlockEntity.de_json({}, client) is None