from .request_test import test_app


def test_200_for_normal_response_validation():
    settings = {
        'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
        'pyramid_swagger.enable_response_validation': True,
    }
    test_app(settings).post_json(
        '/sample',
        {'foo': 'test', 'bar': 'test'},
        status=200
    )


def test_200_skip_validation_with_wrong_response():
    settings = {
        'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
        'pyramid_swagger.skip_validation': '/(sample)\\b',
    }
    test_app(settings).get(
        '/sample/path_arg1/resource',
        params={'required_arg': 'test'},
        status=200
    )

from .request_test import test_app


def test_200_for_normal_response_validation():
    settings = {
        'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
        'pyramid_swagger.enable_swagger_spec_validation': False,
        'pyramid_swagger.enable_response_validation': True,
    }
    test_app(settings).post_json(
        '/sample',
        {'foo': 'test', 'bar': 'test'},
        status=200
    )


def test_200_skip_validation_with_wrong_response():
    settings = {
        'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
        'pyramid_swagger.skip_validation': '/(sample)\\b',
    }
    test_app(settings).get(
        '/sample/path_arg1/resource',
        params={'required_arg': 'test'},
        status=200
    )

Test needs skipping if on p3k
Test needs skipping if on p3k

  from .request_test import test_app
  
  
  def test_200_for_normal_response_validation():
      settings = {
          'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
+         'pyramid_swagger.enable_swagger_spec_validation': False,
          'pyramid_swagger.enable_response_validation': True,
      }
      test_app(settings).post_json(
          '/sample',
          {'foo': 'test', 'bar': 'test'},
          status=200
      )
  
  
  def test_200_skip_validation_with_wrong_response():
      settings = {
          'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
          'pyramid_swagger.skip_validation': '/(sample)\\b',
      }
      test_app(settings).get(
          '/sample/path_arg1/resource',
          params={'required_arg': 'test'},
          status=200
      )
  
Test needs skipping if on p3k
## Code Before:
from .request_test import test_app


def test_200_for_normal_response_validation():
    settings = {
        'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
        'pyramid_swagger.enable_response_validation': True,
    }
    test_app(settings).post_json(
        '/sample',
        {'foo': 'test', 'bar': 'test'},
        status=200
    )


def test_200_skip_validation_with_wrong_response():
    settings = {
        'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
        'pyramid_swagger.skip_validation': '/(sample)\\b',
    }
    test_app(settings).get(
        '/sample/path_arg1/resource',
        params={'required_arg': 'test'},
        status=200
    )

## Instruction:
Test needs skipping if on p3k
## Code After:
from .request_test import test_app


def test_200_for_normal_response_validation():
    settings = {
        'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
        'pyramid_swagger.enable_swagger_spec_validation': False,
        'pyramid_swagger.enable_response_validation': True,
    }
    test_app(settings).post_json(
        '/sample',
        {'foo': 'test', 'bar': 'test'},
        status=200
    )


def test_200_skip_validation_with_wrong_response():
    settings = {
        'pyramid_swagger.schema_directory': 'tests/sample_schemas/good_app/',
        'pyramid_swagger.skip_validation': '/(sample)\\b',
    }
    test_app(settings).get(
        '/sample/path_arg1/resource',
        params={'required_arg': 'test'},
        status=200
    )
