def setUpClass(cls): cls.tempDir = tempfile.TemporaryDirectory() for i in range(10): sampleName = 'sample{}.h'.format(i) filePath = os.path.join(cls.tempDir.name, '{}.h'.format(sampleName)) with open(filePath, 'w') as f: f.write('#define {}'.format(sampleName)) cls.includePaths = list(sorted(clcache.filesBeneath(cls.tempDir.name))) cls.manifestHash = 'ffffffffffffffffffffffffffffffff' cls.expectedManifestEntry = clcache.createManifestEntry(TestCreateManifestEntry.manifestHash, TestCreateManifestEntry.includePaths)
def testIsConsistentWithDuplicateEntries(self): includePathsWithDuplicates = TestCreateManifestEntry.includePaths + TestCreateManifestEntry.includePaths entry = clcache.createManifestEntry(TestCreateManifestEntry.manifestHash, includePathsWithDuplicates) self.assertManifestEntryIsCorrect(entry)
def testIsConsistentWithReverseList(self): reversedIncludePaths = list(reversed(TestCreateManifestEntry.includePaths)) entry = clcache.createManifestEntry(TestCreateManifestEntry.manifestHash, reversedIncludePaths) self.assertManifestEntryIsCorrect(entry)
def testIsConsistentWithSameInput(self): entry = clcache.createManifestEntry(TestCreateManifestEntry.manifestHash, TestCreateManifestEntry.includePaths) self.assertManifestEntryIsCorrect(entry)