How to use the approvaltests.approvals.verify function in approvaltests

To help you get started, we’ve selected a few approvaltests examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github approvals / ApprovalTests.Python / tests / reporters / test_genericdiffreporter.py View on Github external
def test_get_pycharm_reporter(self):
        verify(str(self.factory.get("PyCharm")), reporter=self.reporter)
github Flowminder / FlowKit / flowmachine / functional_tests / test_daily_location.py View on Github external
"""
    subset_query = CustomQuery(
        "SELECT DISTINCT msisdn AS subscriber FROM events.calls WHERE msisdn in ('GNLM7eW5J5wmlwRa', 'e6BxY8mAP38GyAQz', '1vGR8kp342yxEpwY')"
    )
    dl = daily_location(
        "2016-01-05",
        level="cell",
        hours=(23, 5),
        method="last",
        # subscriber_identifier="imei",
        # column_name="admin2pcod",
        # ignore_nulls=False,
        subscriber_subset=subset_query,
    )
    sql = pretty_sql(dl.get_query())
    verify(sql, diff_reporter)
github approvals / ApprovalTests.Python / tests / test_verify.py View on Github external
def test_verify(self):
        verify("Hello World.", self.reporter)
github Flowminder / FlowKit / flowmachine / functional_tests / test_daily_location.py View on Github external
"2016-01-04",
        level="admin2",
        hours=(3, 9),
        method="most-common",
        # subscriber_identifier="imei",
        # column_name="admin2pcod",
        ignore_nulls=False,
        subscriber_subset=[
            "2GJxeNazvlgZbqj6",
            "7qKmzkeMbmk5nOa0",
            "8dpPLR15XwR7jQyN",
            "1NqnrAB9bRd597x2",
        ],
    )
    df = get_dataframe(dl)
    verify(df.to_csv(), diff_reporter)
github Flowminder / FlowKit / flowmachine / functional_tests / test_daily_location.py View on Github external
"""
    subset_query = CustomQuery(
        "SELECT DISTINCT msisdn AS subscriber FROM events.calls WHERE msisdn in ('GNLM7eW5J5wmlwRa', 'e6BxY8mAP38GyAQz', '1vGR8kp342yxEpwY')"
    )
    dl = daily_location(
        "2016-01-05",
        level="cell",
        hours=(23, 5),
        method="last",
        # subscriber_identifier="imei",
        # column_name="admin2pcod",
        # ignore_nulls=False,
        subscriber_subset=subset_query,
    )
    df = get_dataframe(dl)
    verify(df.to_csv(), diff_reporter)
github Flowminder / FlowKit / flowmachine / functional_tests / test_daily_location.py View on Github external
def test_daily_location_4_sql(diff_reporter):
    """
    Regression test; this verifies the SQL statement for the test below (which checks the resulting dataframe)
    """
    subset_query = CustomQuery(
        "SELECT * FROM (VALUES ('dr9xNYK006wykgXj')) as tmp (subscriber)"
    )
    dl = daily_location(
        "2016-01-05",
        table="events.calls",
        hours=(22, 6),
        subscriber_subset=subset_query,
    )
    sql = pretty_sql(dl.get_query())
    verify(sql, diff_reporter)
github tmr232 / Sark / tests / tests.py View on Github external
def test_data(self):
        data = run_dumper('data_dumper.py', 'simple.out.i64')
        verify(data, self.reporter)
github Flowminder / FlowKit / flowmachine / functional_tests / test_daily_location.py View on Github external
def test_daily_location_4_df(get_dataframe, diff_reporter):
    """
    Regression test; the expected result is empty because the given subscriber does not make any calls on the given date.
    """
    subset_query = CustomQuery(
        "SELECT * FROM (VALUES ('dr9xNYK006wykgXj')) as tmp (subscriber)"
    )
    dl = daily_location(
        "2016-01-05",
        table="events.calls",
        hours=(22, 6),
        subscriber_subset=subset_query,
    )
    df = get_dataframe(dl)
    verify(df.to_csv(), diff_reporter)
github approvals / ApprovalTests.Python / examples / text_diff_reporter_example.py View on Github external
def test(self):
        reporter = TextDiffReporter()
        approvals.verify("x", reporter)