Exemple #1
0
    def _filter_estate(estate: Any) -> bool:
        """
        Checks whether estate's viable or not.

        :param estate: target entity to be checked
        :return: is estate correctly parsed
        """
        return (notnull(estate) and notnull(estate.price)
                and notnull(estate.area))
Exemple #2
0
    def _filter_offer(offer: Any) -> bool:
        """
        Checks whether offer's markup is None or not.

        :param offer: target entity to be checked
        :return: is offer's markup None or not
        """
        return notnull(offer['markup'])
Exemple #3
0
    def _filter_price(estate: Any) -> bool:
        """
        Checks whether estate's price is None or not.

        :param estate: target entity to be checked
        :return: is estate's price None or not
        """
        return notnull(estate.price)
Exemple #4
0
    def _filter_geolocation(estate: Any) -> bool:
        """
        Checks whether estate's location is None or not.

        :param estate: target entity to be checked
        :return: is estate's geolocation None or not
        """
        return notnull(estate.geolocation)
Exemple #5
0
    def _validate(self, struct: Any) -> bool:
        """
        The most basic inspection, which implies nullability check.

        :param struct: target object
        :return: whether object is valid or not
        """
        return notnull(struct)
def test_notnull():
    assert notnull({})
    assert notnull(0)
    assert not notnull(None)