Example #1
0
    def configure(self, request):
        self.validate_snapshot = True
        self._set_up()
        try:
            yield

            if self.validate_snapshot:
                default_snapshot_dir = get_default_snapshot_dir(request.node)

                with Snapshot(request.config.option.snapshot_update,
                              request.config.option.allow_snapshot_deletion,
                              default_snapshot_dir) as snapshot:
                    snapshot.assert_match(
                        ConfigBuilder.get_config_as_string().replace('  ', ''),
                        'snapshot.txt')
        finally:
            self._tear_down()
            ConfigBuilder.reset()
 def test_config_builder_output(self, snapshot):
     self.create_instance()
     snapshot.assert_match(ConfigBuilder.get_config_as_string().replace('  ', ''), 'config.txt')