<s> from tarsnapper . config import load_config , ConfigError <EOL> from nose . tools import assert_raises <EOL> def test_empty_config ( ) : <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> def test_aliases ( ) : <EOL> """<STR_LIT>""" <EOL> assert load_config ( """<STR_LIT>""" ) [ <NUM_LIT:0> ] [ '<STR_LIT:foo>' ] . aliases == [ '<STR_LIT:foo>' ] <EOL> assert load_config ( """<STR_LIT>""" ) [ <NUM_LIT:0> ] [ '<STR_LIT:foo>' ] . aliases == [ '<STR_LIT:foo>' ] <EOL> def test_excludes ( ) : <EOL> """<STR_LIT>""" <EOL> assert load_config ( """<STR_LIT>""" ) [ <NUM_LIT:0> ] [ '<STR_LIT:foo>' ] . excludes == [ '<STR_LIT:foo>' ] <EOL> assert load_config ( """<STR_LIT>""" ) [ <NUM_LIT:0> ] [ '<STR_LIT:foo>' ] . excludes == [ '<STR_LIT:foo>' ] <EOL> def test_no_sources ( ) : <EOL> load_config ( """<STR_LIT>""" ) <EOL> def test_no_target ( ) : <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> def test_global_target ( ) : <EOL> assert load_config ( """<STR_LIT>""" ) [ <NUM_LIT:0> ] [ '<STR_LIT:foo>' ] . target == '<STR_LIT>' <EOL> def test_empty_job ( ) : <EOL> """<STR_LIT>""" <EOL> assert load_config ( """<STR_LIT>""" ) [ <NUM_LIT:0> ] [ '<STR_LIT:foo>' ] <EOL> def test_no_deltas ( ) : <EOL> load_config ( """<STR_LIT>""" ) <EOL> def test_global_deltas ( ) : <EOL> assert len ( load_config ( """<STR_LIT>""" ) [ <NUM_LIT:0> ] [ '<STR_LIT:foo>' ] . deltas ) == <NUM_LIT:3> <EOL> def test_target_has_name ( ) : <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> load_config ( """<STR_LIT>""" ) <EOL> def test_target_has_date ( ) : <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> def test_dateformat_inheritance ( ) : <EOL> r , _ = load_config ( """<STR_LIT>""" ) <EOL> assert r [ '<STR_LIT:foo>' ] . dateformat == '<STR_LIT>' <EOL> assert r [ '<STR_LIT:bar>' ] . dateformat == '<STR_LIT>' <EOL> def test_unsupported_keys ( ) : <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> def test_single_source ( ) : <EOL> assert load_config ( """<STR_LIT>""" ) [ <NUM_LIT:0> ] [ '<STR_LIT:foo>' ] . sources == [ '<STR_LIT>' ] <EOL> def test_source_and_sources ( ) : <EOL> """<STR_LIT>""" <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> def test_alias_and_aliases ( ) : <EOL> """<STR_LIT>""" <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> def test_exclude_and_excludes ( ) : <EOL> """<STR_LIT>""" <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> def test_named_delta ( ) : <EOL> c = load_config ( """<STR_LIT>""" ) <EOL> assert len ( c [ <NUM_LIT:0> ] [ '<STR_LIT>' ] . deltas ) == <NUM_LIT:2> <EOL> assert len ( c [ <NUM_LIT:0> ] [ '<STR_LIT:foo>' ] . deltas ) == <NUM_LIT:3> <EOL> assert len ( c [ <NUM_LIT:0> ] [ '<STR_LIT:bar>' ] . deltas ) == <NUM_LIT:4> <EOL> def test_unspecified_named_delta ( ) : <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> def test_undefined_named_delta ( ) : <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) <EOL> def test_named_delta_and_deltas ( ) : <EOL> """<STR_LIT>""" <EOL> assert_raises ( ConfigError , load_config , """<STR_LIT>""" ) </s>
