def test_list_objects_bad_sort_key(self, test_model): with pytest.raises(ValueError): mackinac.list_workspace_objects(test_model['ref'], sort_key='foobar')
def test_list_objects_no_exist_folder(self): no_exist_reference = '/{0}/modelseed/badref'.format( mackinac.workspace.ws_client.username) output = mackinac.list_workspace_objects(no_exist_reference) assert output is None
def test_list_objects_bad_folder(self): # This fails because there is no leading forward slash. bad_reference = '{0}/modelseed/badref'.format( mackinac.workspace.ws_client.username) with pytest.raises(mackinac.SeedClient.ObjectNotFoundError): mackinac.list_workspace_objects(bad_reference)
def test_list_objects_by_type(self, test_model): output = mackinac.list_workspace_objects(test_model['ref'], sort_key='type') assert len(output) == 8 assert output[2][1] == 'genome' assert output[4][1] == 'model'
def test_list_objects_by_name(self, test_model): output = mackinac.list_workspace_objects(test_model['ref'], sort_key='name') assert len(output) == 8 assert output[0][0] == '{0}.cpdtbl'.format(test_model['id'])
def test_list_objects(self, test_model): output = mackinac.list_workspace_objects(test_model['ref']) assert len(output) == 8 assert len(output[0]) == 12