def test_getattr_for_truncated_file(self): client = KubernetesClient() pod = client.get_pods()[0] fs = KubeFileSystem(client) path = '/default/pod/%s/json' % pod fs.truncate(path, 0) attr = fs.getattr(path) assert_that(attr['st_size'], is_(0))
def test_truncate_and_write(self): client = KubernetesClient() fs = KubeFileSystem(client) pod = client.get_pods()[0] path = '/default/pod/%s/yaml' % pod fs.truncate(path, 0) fs.write(path, 'test', 0) fs.write(path, 'write', 4) fs.sync(path, dry_run=True) data = fs.read(path, 1000, 0) assert_that(data, is_(b'testwrite'))
def test_truncate_and_write(self): client = KubernetesClient() fs = KubeFileSystem(client) pod = client.get_pods()[0] path = '/default/pod/%s/yaml' % pod fs.truncate(path, 0) fs.write(path, 'test', 0) fs.write(path, 'write', 4) fs.sync(path, dry_run=True) data = fs.read(path, 1000, 0) assert_that(data, is_('testwrite'))