Example #1
0
def test_failures():
    assert_raises(ParseError, parse, my_problematic_cnf.splitlines())
    try:
        parse(my_problematic_cnf.splitlines())
    except ParseError, exc:
        cfg = exc.config
        ok_('mysqld' in cfg)
        assert_equals(len(exc.errors), 1)
Example #2
0
def test_parse():
    cfg = parse(my_cnf.splitlines())
    assert_equals(cfg['mysqld']['innodb_file_per_table'], None)
    assert_equals(cfg['mysqld']['replicate-wild-do-table'], 'bar.%')
    assert_equals(cfg['mysqld'].getall('replicate-wild-do-table'),
                  ['foo.%', 'bar.%'])
    assert_equals(cfg['mysqldump'].getall('ignore-table'),
                  ['foo.bar', 'foo.baz', 'foo.biz', 'foo.boz'])