コード例 #1
0
ファイル: test_filesystem.py プロジェクト: mboersma/kubefuse
 def test_list_files_for_resource(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/default/pod'
     files = fs.list_files(path)
     pods = client.get_pods()
     assert_that(files, contains(*pods))
コード例 #2
0
ファイル: test_filesystem.py プロジェクト: opencredo/kubefuse
 def test_list_files_for_resource(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/default/pod'
     files = fs.list_files(path)
     pods = client.get_pods()
     assert_that(files, contains(*pods))
コード例 #3
0
ファイル: test_filesystem.py プロジェクト: opencredo/kubefuse
 def test_list_files_for_root(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/'
     files = fs.list_files(path)
     namespaces = client.get_namespaces()
     assert_that(files, contains(*namespaces))
     assert_that(len(files), is_(len(namespaces)))
コード例 #4
0
ファイル: test_filesystem.py プロジェクト: opencredo/kubefuse
 def test_list_files_for_rc(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     rc = client.get_replication_controllers()[0]
     path = '/default/rc/%s' % rc
     files = fs.list_files(path)
     assert_that(files, has_items('describe', 'json', 'yaml'))
     assert_that(len(files), is_(3))
コード例 #5
0
ファイル: test_filesystem.py プロジェクト: opencredo/kubefuse
 def test_list_files_for_pod(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     pod = client.get_pods()[0]
     path = '/default/pod/%s' % pod
     files = fs.list_files(path)
     assert_that(files, has_items('describe', 'logs', 'json', 'yaml'))
     assert_that(len(files), is_(4))
コード例 #6
0
ファイル: test_filesystem.py プロジェクト: opencredo/kubefuse
 def test_list_files_for_namespace(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/default'
     files = fs.list_files(path)
     assert_that(files, contains_inanyorder('pod', 'svc', 'rc', 'deployments', 'nodes', 'events',
         'limits', 'pv', 'pvc', 'quota', 'endpoints', 'serviceaccounts', 'jobs', 'replicasets',
         'configmaps', 'secrets', 'componentstatuses', 'daemonsets', 'horizontalpodautoscalers', 'ingress'))
コード例 #7
0
 def test_list_files_for_namespace(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/default'
     files = fs.list_files(path)
     assert_that(files, contains('pod', 'svc', 'rc', 'nodes', 'events',
         'cs', 'limits', 'pv', 'pvc', 'quota', 'endpoints', 'serviceaccounts',
         'secrets'))
コード例 #8
0
ファイル: test_filesystem.py プロジェクト: mboersma/kubefuse
 def test_list_files_for_root(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/'
     files = fs.list_files(path)
     namespaces = client.get_namespaces()
     assert_that(files, contains(*namespaces))
     assert_that(len(files), is_(len(namespaces)))
コード例 #9
0
ファイル: test_filesystem.py プロジェクト: mboersma/kubefuse
 def test_list_files_for_rc(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     rc = client.get_replication_controllers()[0]
     path = '/default/rc/%s' % rc
     files = fs.list_files(path)
     assert_that(files, has_items('describe', 'json', 'yaml'))
     assert_that(len(files), is_(3))
コード例 #10
0
ファイル: test_filesystem.py プロジェクト: mboersma/kubefuse
 def test_list_files_for_pod(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     pod = client.get_pods()[0]
     path = '/default/pod/%s' % pod
     files = fs.list_files(path)
     assert_that(files, has_items('describe', 'logs', 'json', 'yaml'))
     assert_that(len(files), is_(4))
コード例 #11
0
ファイル: test_filesystem.py プロジェクト: mboersma/kubefuse
 def test_list_files_for_namespace(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/default'
     files = fs.list_files(path)
     assert_that(
         files,
         contains('pod', 'svc', 'rc', 'nodes', 'events', 'cs', 'limits',
                  'pv', 'pvc', 'quota', 'endpoints', 'serviceaccounts',
                  'secrets'))
コード例 #12
0
ファイル: test_filesystem.py プロジェクト: timstoop/kubefuse
 def test_list_files_for_namespace(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/default'
     files = fs.list_files(path)
     assert_that(
         files,
         contains_inanyorder('pod', 'svc', 'rc', 'deployments', 'nodes',
                             'events', 'limits', 'pv', 'pvc', 'quota',
                             'endpoints', 'serviceaccounts', 'jobs',
                             'replicasets', 'configmaps', 'secrets',
                             'componentstatuses', 'daemonsets',
                             'horizontalpodautoscalers', 'ingress'))
コード例 #13
0
ファイル: test_filesystem.py プロジェクト: opencredo/kubefuse
 def test_list_files_for_nonexistent_path(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/doesnt-exist'
     assert_that(calling(lambda: fs.list_files(path)), raises(FuseOSError))
コード例 #14
0
ファイル: test_filesystem.py プロジェクト: opencredo/kubefuse
 def test_list_files_for_file_throws_exception(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     pod = client.get_pods()[0]
     path = '/default/pod/%s/describe' % pod
     assert_that(calling(lambda: fs.list_files(path)), raises(FuseOSError))
コード例 #15
0
ファイル: test_filesystem.py プロジェクト: mboersma/kubefuse
 def test_list_files_for_nonexistent_path(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     path = '/doesnt-exist'
     assert_that(calling(lambda: fs.list_files(path)), raises(FuseOSError))
コード例 #16
0
ファイル: test_filesystem.py プロジェクト: mboersma/kubefuse
 def test_list_files_for_file_throws_exception(self):
     client = KubernetesClient()
     fs = KubeFileSystem(client)
     pod = client.get_pods()[0]
     path = '/default/pod/%s/describe' % pod
     assert_that(calling(lambda: fs.list_files(path)), raises(FuseOSError))