6 from odltools import logg
7 from odltools.mdsal import cmd
8 from odltools.mdsal.tests import Args
11 @unittest.skip("skipping")
12 class TestCmd(unittest.TestCase):
14 logg.Logger(logging.INFO, logging.INFO)
15 self.args = Args(path="/tmp/testmodels", pretty_print=True)
17 def test_get_all_dumps(self):
18 # Ensure odl is running at localhost:8181
19 # Remove an existing directory
20 if os.path.exists(self.args.path):
21 if os.path.islink(self.args.path):
22 os.unlink(self.args.path)
24 shutil.rmtree(self.args.path)
26 cmd.get_all_dumps(self.args)
28 # assert each model has been saved to a file
29 for res in cmd.DSMAP.itervalues():
30 store = res[cmd.DSM_DSTYPE]
31 model_path = res[cmd.DSM_PATH]
32 path_split = cmd.split_model_path(model_path)
33 filename = cmd.make_filename(self.args.path, store, path_split.name, path_split.container)
34 self.assertTrue(os.path.isfile(filename))
37 if __name__ == '__main__':