def test_schema_titles(): """ Tests to make sure an error is thrown if the schema titles to not match """ try: schema_check(GRADUATES_WRONG, MANAGERS) except MismatchedAttributesException: assert True else: assert False try: union(GRADUATES_WRONG, MANAGERS) except MismatchedAttributesException: assert True else: assert False try: intersection(GRADUATES_WRONG, MANAGERS) except MismatchedAttributesException: assert True else: assert False try: difference(GRADUATES_WRONG, MANAGERS) except MismatchedAttributesException: assert True else: assert False
def test_schema_columns(): """ Test to make sure an error is thrown if the amount of columns of the table do not match """ try: schema_check(GRADUATES, MANAGERS_WRONG) except MismatchedAttributesException: assert True else: assert False try: union(GRADUATES_WRONG, MANAGERS) except MismatchedAttributesException: assert True else: assert False try: intersection(GRADUATES_WRONG, MANAGERS) except MismatchedAttributesException: assert True else: assert False try: difference(GRADUATES_WRONG, MANAGERS) except MismatchedAttributesException: assert True else: assert False
def test_schema_error(): """ Tests that an error will not be thrown when schemas are matching """ try: schema_check(GRADUATES, MANAGERS) except MismatchedAttributesException: assert False else: assert True
def test_schema_check(): """ Test to determine whether an error is thrown if the columns do not match """ try: schema_check(GRADUATES, MNGRS_WRONG) except MismatchedAttributesException: assert True else: assert False try: schema_check(GRADS_WRONG, MANAGERS) except MismatchedAttributesException: assert True else: assert False