Exemplo n.º 1
0
 def make_fs_with_backend(self, backend, text):
     """
     Create a FileSystem instance from text with a specific backend
     instance.
     """
     self._testfile = makeTempFile(text)
     fs = FileSystem(self._testfile.name)
     fs.backend = backend
     fs.setup_target_devices()
     return fs
Exemplo n.º 2
0
 def testLoadFile(self):
     """create a FileSystem from model example.lmf"""
     fs = FileSystem(filename="../conf/models/example.lmf")
     self.assertEqual(len(fs.model), 15)
Exemplo n.º 3
0
 def _compare(self, orig, new):
     tmpfile = makeTempFile(orig)
     origconf = FileSystem(tmpfile.name)
     newfile = makeTempFile(new)
     newconf = FileSystem(newfile.name)
     return origconf.compare(newconf)
Exemplo n.º 4
0
 def _compare(self, orig, new):
     tmpfile = makeTempFile(textwrap.dedent(orig))
     origconf = FileSystem(tmpfile.name)
     newfile = makeTempFile(textwrap.dedent(new))
     newconf = FileSystem(newfile.name)
     return origconf.compare(newconf)
Exemplo n.º 5
0
 def load_from_model(cls, lmf):
     conf = Configuration()
     conf._fs = FileSystem(lmf)
     return conf