def to_master(self, repo, commit): first = 'first' second = 'second' file1 = (self.pro1.root / 'test_file_2') file1.write_text(first) return ( repo / commit(first) @ (lambda: file1.write_text(second)) / commit(second) / __.prev() @ (lambda: file1.read_text().should.equal(first)) / __.next() @ (lambda: file1.read_text().should.equal(second)) )
def prev_next(self, repo, commit): first = 'first' second = 'second' file1 = (self.pro1.root / 'test_file_2') file2 = (self.pro1.root / 'test_file') file1.write_text(first) return ( repo / commit(first) @ (lambda: file2.write_text(first)) / commit(second) @ (lambda: file1.write_text(second)) / commit('third') % (lambda a: a.history.should.have.length_of(3)) @ (lambda: file1.read_text().should.equal(second)) / __.prev() @ (lambda: file1.read_text().should.equal(first)) / __.next() @ (lambda: file1.read_text().should.equal(second)) )
def next(self): return self._switch(__.next())