Esempio n. 1
0
def mock_touch(self, bearer, version=None, revision=None, **kwargs):
    if version:
        if self.versions:
            try:
                return self.versions[int(version) - 1]
            except (IndexError, ValueError):
                return None
        else:
            return None
    return file_models.FileVersion()
Esempio n. 2
0
 def get_second_test_file(self):
     version = file_models.FileVersion(identifier='1')
     version.save()
     ret = GithubFile(
         name='Test2',
         node=self.project,
         path='/test/Test2',
         materialized_path='/test/Test2',
     )
     ret.save()
     ret.versions.add(version)
     return ret