def test_read_describe(self): client = KubernetesClient() fs = KubeFileSystem(client) pod = client.get_pods()[0] path = '/default/pod/%s/describe' % pod data = fs.read(path, 50000, 0) assert_that(data, equal_to(client.describe('default', 'pod', pod)))
def test_getattr_for_action(self): client = KubernetesClient() pod = client.get_pods()[0] fs = KubeFileSystem(client) path = '/default/pod/%s/describe' % pod attr = fs.getattr(path) data = client.describe('default', 'pod', pod) assert_that(attr['st_mode'], is_(stat.S_IFREG | 0o444)) assert_that(attr['st_nlink'], is_(1)) assert_that(attr['st_size'], is_(len(data)))
def test_getattr_for_action(self): client = KubernetesClient() pod = client.get_pods()[0] fs = KubeFileSystem(client) path = '/default/pod/%s/describe' % pod attr = fs.getattr(path) data = client.describe('default', 'pod', pod) assert_that(attr['st_mode'], is_(stat.S_IFREG | 0444)) assert_that(attr['st_nlink'], is_(1)) assert_that(attr['st_size'], is_(len(data)))
def test_describe(self): client = KubernetesClient() pods = client.get_pods("default") describe = client.describe('default', 'pod', pods[0]) assert_that(str(describe), contains_string(pods[0]))
def test_describe(self): client = KubernetesClient() pods = client.get_pods("default") describe = client.describe('default', 'pod', pods[0]) assert_that(describe, contains_string(pods[0]))