def test_BasicDatasetProfiler_with_context(empty_data_context, filesystem_csv_2):
    empty_data_context.add_datasource('my_datasource', module_name='great_expectations.datasource', class_name='PandasDatasource', base_directory=str(filesystem_csv_2))
    not_so_empty_data_context = empty_data_context
    not_so_empty_data_context.create_expectation_suite('my_datasource/f1', 'default')
    batch_kwargs = not_so_empty_data_context.yield_batch_kwargs('my_datasource/f1')
    batch = not_so_empty_data_context.get_batch('my_datasource/f1', 'default', batch_kwargs)
    (expectations_config, validation_results) = BasicDatasetProfiler.profile(batch)
    assert (expectations_config['data_asset_name'] == 'my_datasource/default/f1')
    assert (expectations_config['expectation_suite_name'] == 'default')
    assert ('BasicDatasetProfiler' in expectations_config['meta'])
    assert (set(expectations_config['meta']['BasicDatasetProfiler'].keys()) == {'created_by', 'created_at', 'batch_kwargs'})
    for exp in expectations_config['expectations']:
        assert ('BasicDatasetProfiler' in exp['meta'])
        assert ('confidence' in exp['meta']['BasicDatasetProfiler'])
    assert (validation_results['meta']['data_asset_name'] == 'my_datasource/default/f1')
    assert (set(validation_results['meta'].keys()) == {'great_expectations.__version__', 'data_asset_name', 'expectation_suite_name', 'run_id', 'batch_kwargs', 'batch_id'})
def test_BasicDatasetProfiler_with_context(empty_data_context, filesystem_csv_2):
    empty_data_context.add_datasource('my_datasource', module_name='great_expectations.datasource', class_name='PandasDatasource', base_directory=str(filesystem_csv_2))
    not_so_empty_data_context = empty_data_context
    not_so_empty_data_context.create_expectation_suite('my_datasource/f1', 'default')
    batch_kwargs = not_so_empty_data_context.yield_batch_kwargs('my_datasource/f1')
    batch = not_so_empty_data_context.get_batch('my_datasource/f1', 'default', batch_kwargs)
    (expectations_config, validation_results) = BasicDatasetProfiler.profile(batch)
    assert (expectations_config['data_asset_name'] == 'my_datasource/default/f1')
    assert (expectations_config['expectation_suite_name'] == 'default')
    assert ('BasicDatasetProfiler' in expectations_config['meta'])
    assert (set(expectations_config['meta']['BasicDatasetProfiler'].keys()) == {'created_by', 'created_at', 'batch_kwargs'})
    for exp in expectations_config['expectations']:
        assert ('BasicDatasetProfiler' in exp['meta'])
        assert ('confidence' in exp['meta']['BasicDatasetProfiler'])
    assert (validation_results['meta']['data_asset_name'] == 'my_datasource/default/f1')
    assert (set(validation_results['meta'].keys()) == {'great_expectations.__version__', 'data_asset_name', 'expectation_suite_name', 'run_id', 'batch_kwargs', 'batch_id'})