Пример #1
0
    def testRepositoryWithOneFile(self):
        self.GivenRepositoryStructure(['File1.mof'])

        repository = MofFileRepository('./repository/')
        moffiles = repository.GetAllMofFiles()
        moffilenames = self.GetMofFileNames(moffiles)
        self.assertEqual(moffilenames, ['./repository/File1.mof'])
Пример #2
0
    def testNonMofFilesAreIgnored(self):
        self.GivenRepositoryStructure(
            ['File1.mof', 'directory1/File2.mof', 'directory2/File3.notmof'])

        repository = MofFileRepository('./repository/')
        self.assertEqual(
            self.GetMofFileNames(repository.GetAllMofFiles()).sort(),
            ['./repository/File1.mof',
             './repository/directory1/File2.mof'].sort())
Пример #3
0
    def testRecursiveRepositoryWith3Files(self):
        self.GivenRepositoryStructure(
            ['File1.mof', 'directory1/File2.mof', 'directory2/File3.mof'])

        repository = MofFileRepository('./repository/')
        self.assertEqual(
            self.GetMofFileNames(repository.GetAllMofFiles()).sort(), [
                './repository/File1.mof', './repository/directory1/File2.mof',
                './repository/directory2/File3.mof'
            ].sort())
Пример #4
0
 def testEmptyRepository(self):
     repository = MofFileRepository('./repository/')
     self.assertEqual(repository.GetAllMofFiles(), [])