def testRemoveNoDocs(self):
    expected_nodoc = [
      {
        'name': 'B',
        'list': [
          {
            'name': 'B2'
          }
        ]
      },
      {
        'name': 'D',
        'nodoc': False
      },
      {
        'name': 'E',
        'items1': [
          {
            'name': 'E1',
            'items': [
              {
                'name': 'E1.3'
              }
            ]
          },
          {
            'name': 'E2'
          }
        ]
      }
    ]

    nodoc_data = [
      {
        'name': 'A',
        'nodoc': True
      },
      {
        'name': 'B',
        'list': [
          {
            'name': 'B1',
            'nodoc': True
          },
          {
            'name': 'B2'
          },
          {
            'name': 'B3',
            'nodoc': True
          }
        ]
      },
      {
        'name': 'C',
        'nodoc': True
      },
      {
        'name': 'D',
        'nodoc': False
      },
      {
        'name': 'E',
        'dict': {
          'name': 'Ed',
          'nodoc': True
        },
        'items1': [
          {
            'name': 'E1',
            'items': [
              {
                'name': 'E1.1',
                'nodoc': True
              },
              {
                'name': 'E1.2',
                'nodoc': True
              },
              {
                'name': 'E1.3'
              }
            ]
          },
          {
            'name': 'E2'
          },
          {
            'name': 'E3',
            'nodoc': True
          }
        ]
      }
    ]

    object_store_creator = ObjectStoreCreator(start_empty=False)
    host_file_system_provider = HostFileSystemProvider(object_store_creator)
    schema_processor = SchemaProcessor(_FakeReferenceResolver(),
                                       _FakeAPIModels(),
                                       _FakeFeaturesBundle(),
                                       CompiledFileSystem.Factory(
                                           object_store_creator),
                                       host_file_system_provider.GetMaster(),
                                       True)
    schema_processor._RemoveNoDocs(nodoc_data)
    self.assertEquals(expected_nodoc, nodoc_data)
  def testRemoveNoDocs(self):
    expected_nodoc = [
      {
        'name': 'B',
        'list': [
          {
            'name': 'B2'
          }
        ]
      },
      {
        'name': 'D',
        'nodoc': False
      },
      {
        'name': 'E',
        'items1': [
          {
            'name': 'E1',
            'items': [
              {
                'name': 'E1.3'
              }
            ]
          },
          {
            'name': 'E2'
          }
        ]
      }
    ]

    nodoc_data = [
      {
        'name': 'A',
        'nodoc': True
      },
      {
        'name': 'B',
        'list': [
          {
            'name': 'B1',
            'nodoc': True
          },
          {
            'name': 'B2'
          },
          {
            'name': 'B3',
            'nodoc': True
          }
        ]
      },
      {
        'name': 'C',
        'nodoc': True
      },
      {
        'name': 'D',
        'nodoc': False
      },
      {
        'name': 'E',
        'dict': {
          'name': 'Ed',
          'nodoc': True
        },
        'items1': [
          {
            'name': 'E1',
            'items': [
              {
                'name': 'E1.1',
                'nodoc': True
              },
              {
                'name': 'E1.2',
                'nodoc': True
              },
              {
                'name': 'E1.3'
              }
            ]
          },
          {
            'name': 'E2'
          },
          {
            'name': 'E3',
            'nodoc': True
          }
        ]
      }
    ]

    object_store_creator = ObjectStoreCreator(start_empty=False)
    host_file_system_provider = HostFileSystemProvider(object_store_creator)
    schema_processor = SchemaProcessor(_FakeReferenceResolver(),
                                       _FakeAPIModels(),
                                       _FakeFeaturesBundle(),
                                       CompiledFileSystem.Factory(
                                           object_store_creator),
                                       host_file_system_provider.GetMaster(),
                                       True)
    schema_processor._RemoveNoDocs(nodoc_data)
    self.assertEquals(expected_nodoc, nodoc_data)