<s> from __future__ import absolute_import <EOL> from __future__ import unicode_literals <EOL> import jsonschema . exceptions <EOL> import pytest <EOL> from git_code_debt . generate_config import GenerateOptions <EOL> def test_empty_config_invalid ( ) : <EOL> with pytest . raises ( jsonschema . exceptions . ValidationError ) : <EOL> GenerateOptions . from_yaml ( { } ) <EOL> def test_with_all_options_specified ( ) : <EOL> ret = GenerateOptions . from_yaml ( { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : '<STR_LIT:.>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } ) <EOL> assert ret == GenerateOptions ( <EOL> skip_default_metrics = True , <EOL> metric_package_names = [ '<STR_LIT>' ] , <EOL> repo = '<STR_LIT:.>' , <EOL> database = '<STR_LIT>' , <EOL> ) <EOL> def test_minimal_defaults ( ) : <EOL> ret = GenerateOptions . from_yaml ( { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } ) <EOL> assert ret == GenerateOptions ( <EOL> skip_default_metrics = False , <EOL> metric_package_names = [ ] , <EOL> repo = '<STR_LIT>' , <EOL> database = '<STR_LIT>' , <EOL> ) <EOL> def test_none_for_tempdir_allowed ( ) : <EOL> ret = GenerateOptions . from_yaml ( { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } ) <EOL> assert ret == GenerateOptions ( <EOL> skip_default_metrics = False , <EOL> metric_package_names = [ ] , <EOL> repo = '<STR_LIT>' , <EOL> database = '<STR_LIT>' , <EOL> ) <EOL> def test_to_yaml_all_specified ( ) : <EOL> ret = GenerateOptions ( <EOL> skip_default_metrics = True , <EOL> metric_package_names = [ '<STR_LIT>' ] , <EOL> repo = '<STR_LIT:.>' , <EOL> database = '<STR_LIT>' , <EOL> ) . to_yaml ( ) <EOL> assert ret == { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> '<STR_LIT>' : '<STR_LIT:.>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> def test_to_yaml_defaults ( ) : <EOL> ret = GenerateOptions ( <EOL> skip_default_metrics = False , <EOL> metric_package_names = [ ] , <EOL> repo = '<STR_LIT:.>' , <EOL> database = '<STR_LIT>' , <EOL> ) . to_yaml ( ) <EOL> assert ret == { '<STR_LIT>' : '<STR_LIT:.>' , '<STR_LIT>' : '<STR_LIT>' } </s>
