def check_db(self, run, correct_database_code, msg=None):
        """Test DB_THEORY.

        Check that runtime RUN.theory[DB_THEORY] is
        equal to CORRECT_DATABASE_CODE.
        """
        # extract correct answer from correct_database_code
        self.open(msg)
        correct_database = agnostic.string_to_database(correct_database_code)
        self.check_db_diffs(run.theory[DB_THEORY], correct_database, msg)
        self.close(msg)
    def check_db(self, run, correct_database_code, msg=None):
        """Test DB_THEORY.

        Check that runtime RUN.theory[DB_THEORY] is
        equal to CORRECT_DATABASE_CODE.
        """
        # extract correct answer from correct_database_code
        self.open(msg)
        correct_database = agnostic.string_to_database(correct_database_code)
        self.check_db_diffs(run.theory[DB_THEORY],
                            correct_database, msg)
        self.close(msg)
    def check_class(self, run, correct_database_code, msg=None):
        """Test MAT_THEORY.

        Check that runtime RUN's MAT_THEORY theory
        has exactly the same contents as CORRECT_DATABASE_CODE.
        """
        self.open(msg)
        db_class = run.theory[MAT_THEORY].database
        # self.showdb(run)
        correct = agnostic.string_to_database(correct_database_code)
        self.check_db_diffs(db_class, correct, msg)
        self.close(msg)
Example #4
0
    def check_class(self, run, correct_database_code, msg=None):
        """Test MAT_THEORY.

        Check that runtime RUN's MAT_THEORY theory
        has exactly the same contents as CORRECT_DATABASE_CODE.
        """
        self.open(msg)
        db_class = run.theory[MAT_THEORY].database
        # self.showdb(run)
        correct = agnostic.string_to_database(correct_database_code)
        self.check_db_diffs(db_class, correct, msg)
        self.close(msg)
Example #5
0
def db_equal(actual_string, correct_string, output_diff=True):
    """Check if two strings representing data theories are the same."""
    actual = agnostic.string_to_database(actual_string)
    correct = agnostic.string_to_database(correct_string)
    return check_db_diffs(actual, correct, output_diff=output_diff)
Example #6
0
def db_equal(actual_string, correct_string, output_diff=True):
    """Check if two strings representing data theories are the same."""
    actual = agnostic.string_to_database(actual_string)
    correct = agnostic.string_to_database(correct_string)
    return check_db_diffs(actual, correct, output_diff=output_diff)