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)
def test_utc_time(): utcnow = lambda: START_OF_EPOCH + timedelta(seconds=22) assert utc_time(utcnow=utcnow) == 22