Skip to content

Commit

Permalink
Internal
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 700037990
  • Loading branch information
liangyaning33 authored and Orbax Authors committed Nov 25, 2024
1 parent 46d159e commit 0a298fa
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions checkpoint/orbax/checkpoint/_src/path/snapshot/snapshot_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ def __init__(self, *args, **kwargs):
f.write('data')

def test_create_snapshot(self):
dst_dir = '/tmp/test/path/to/dest/'

# dst_dir = epath.Path(self.create_tempdir(name='dest').full_path)
self.assertFalse(os.path.exists(dst_dir))
snapshot.DefaultSnapshot.create_snapshot(str(self.source_dir), str(dst_dir))
self.assertTrue(os.path.exists(dst_dir))
with open(os.path.join(dst_dir, 'data.txt')) as f:
self.assertEqual('data', f.read())
f.close()
return RuntimeError('test')

# dst_dir = '/tmp/test/path/to/dest/'

# # dst_dir = epath.Path(self.create_tempdir(name='dest').full_path)
# self.assertFalse(os.path.exists(dst_dir))
# snapshot.DefaultSnapshot.create_snapshot(str(self.source_dir),
# str(dst_dir))
# self.assertTrue(os.path.exists(dst_dir))
# with open(os.path.join(dst_dir, 'data.txt')) as f:
# self.assertEqual('data', f.read())
# f.close()

def test_release_snapshot(self):
self.assertTrue(os.path.exists(self.source_dir))
Expand Down

0 comments on commit 0a298fa

Please sign in to comment.