예제 #1
0
파일: core.py 프로젝트: jgosmann/fridge
 def add_commit(self, snapshot_key, message):
     # pylint: disable=no-member
     commit = self.resolve_ref(self.get_head())
     c = Commit(utc_time(), snapshot_key, message, commit)
     tmp_file = os.path.join(self._path, '.fridge', 'tmp')
     with self._fs.open(tmp_file, 'w') as f:
         f.write(c.serialize())
     return self._commits.store(tmp_file)
예제 #2
0
def test_utc_time():
    utcnow = lambda: START_OF_EPOCH + timedelta(seconds=22)
    assert utc_time(utcnow=utcnow) == 22