• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import yaml
2
3def test_dump(verbose=False):
4    assert yaml.dump(['foo'])
5test_dump.unittest = True
6
7def test_load_no_loader(verbose=False):
8    try:
9        yaml.load("- foo\n")
10    except TypeError:
11        return True
12    assert(False, "load() require Loader=...")
13test_load_no_loader.unittest = True
14
15def test_load_safeloader(verbose=False):
16    assert yaml.load("- foo\n", Loader=yaml.SafeLoader)
17test_load_safeloader.unittest = True
18
19if __name__ == '__main__':
20    import sys, test_load
21    sys.modules['test_load'] = sys.modules['__main__']
22    import test_appliance
23    test_appliance.run(globals())
24