Exemple #1
0
    def __estimate_dumpsize(self):
        """
        Makes a guess on the dump size using internal database metrics
        :return: A value in bytes, or None (unknown)
        """
        statement = query_factory.get_dumpsize_estimate(self.db_name)
        process_output = self.__runner.get_single_result(statement)

        try:
            return int(process_output)
        except ValueError:
            # Value unparsable, likely NULL
            return None
def test_get_dumpsize_estimate():
    assert query_factory.get_dumpsize_estimate("test") == "SELECT 1;"