# Path: tests/pulp_test.py
# def requires(*things):
# def requires_any(thing, condition=lambda item: True):
#     def wrapped():
#     def setUpClass(cls):
#     def assertPulpOK(self):
#     def assertPulp(self, code=200, data={}):
#     def assertEqual(self, a, b, msg=None):
#     def tearDownClass(cls):
# def agent_test(catching=False, frequency=1):
#     def decorator_maker(method):
#         def decorated_method(self):
#     def setUpClass(cls):
#     def tearDownClass(cls):
# def stacked_ctx(ctxmanager):
#     def stacked(*things):
# def calling_method(thing, method, *args, **kvs):
# def deleting(pulp, *things):
#     def wrapper_ctx(thing):
# class PulpTest(unittest.TestCase):
# class ConsumerAgentPulpTest(PulpTest):
# class InventoryInducedSkip(unittest.SkipTest):
# 
# Path: pulp_auto/repo_group.py
# class RepoGroup(item.Item):
#     path = '/repo_groups/'
#     relevant_data_keys = ['id', 'display_name', 'description', 'repo_ids', 'notes']
#     
#     def associate_repo(
#         self,
#         pulp,
#         data={
#             'criteria': {
#             }
#         },
#         path='/actions/associate/'
#     ):
#         print 
#         return pulp.send(self.request('POST', path=path, data=data))
#         
#     def unassociate_repo(
#         self,
#         pulp,
#         data={
#             'criteria': {
#             }
#         },
#         path='/actions/unassociate/'
#     ):
#         return pulp.send(self.request('POST', path=path, data=data))
# 
#     def associate_distributor(
#         self,
#         pulp,
#         data,
#         path='/distributors/'
#     ):
#         return pulp.send(self.request('POST', path=path, data=data))
# 
#     def get_distributor(
#         self,
#         pulp,
#         id,
#     ):
#         path = path_join(GroupDistributor.path, id)
#         with pulp.asserting(True):
#             return GroupDistributor.from_response(pulp.send(self.request('GET', path=path)))
# 
# 
#     def list_distributors(
#         self,
#         pulp,
#     ):
#         path = GroupDistributor.path
#         with pulp.asserting(True):
#             return pulp.send(self.request('GET', path=path)).json()
# 
#     def publish(
#         self,
#         pulp,
#         distributor_group_id,
#         config = None,
#         path='/actions/publish/'
#     ):
#         data={
#             'id': distributor_group_id,
#             'override_config': config
#         }
#         return pulp.send(self.request('POST', path=path, data=data))
# 
# class GroupDistributor(item.AssociatedItem):
#     path = '/distributors/'
#     relevant_data_keys = ['id', 'distributor_type_id', 'repo_group_id', 'config', 'last_publish']


import json
from tests import pulp_test
from pulp_auto.repo_group import RepoGroup, GroupDistributor


def setUpModule():
    pass


class DistributorGroupTest(pulp_test.PulpTest):
    @classmethod
    def setUpClass(cls):
        super(DistributorGroupTest, cls).setUpClass()
        # create repo_group
        repo_group=RepoGroup(data={'id': cls.__name__ + "_repo_group"})
        response=repo_group.create(cls.pulp)

# Path: tests/pulp_test.py
# def requires(*things):
# def requires_any(thing, condition=lambda item: True):
#     def wrapped():
#     def setUpClass(cls):
#     def assertPulpOK(self):
#     def assertPulp(self, code=200, data={}):
#     def assertEqual(self, a, b, msg=None):
#     def tearDownClass(cls):
# def agent_test(catching=False, frequency=1):
#     def decorator_maker(method):
#         def decorated_method(self):
#     def setUpClass(cls):
#     def tearDownClass(cls):
# def stacked_ctx(ctxmanager):
#     def stacked(*things):
# def calling_method(thing, method, *args, **kvs):
# def deleting(pulp, *things):
#     def wrapper_ctx(thing):
# class PulpTest(unittest.TestCase):
# class ConsumerAgentPulpTest(PulpTest):
# class InventoryInducedSkip(unittest.SkipTest):
# 
# Path: pulp_auto/repo_group.py
# class RepoGroup(item.Item):
#     path = '/repo_groups/'
#     relevant_data_keys = ['id', 'display_name', 'description', 'repo_ids', 'notes']
#     
#     def associate_repo(
#         self,
#         pulp,
#         data={
#             'criteria': {
#             }
#         },
#         path='/actions/associate/'
#     ):
#         print 
#         return pulp.send(self.request('POST', path=path, data=data))
#         
#     def unassociate_repo(
#         self,
#         pulp,
#         data={
#             'criteria': {
#             }
#         },
#         path='/actions/unassociate/'
#     ):
#         return pulp.send(self.request('POST', path=path, data=data))
# 
#     def associate_distributor(
#         self,
#         pulp,
#         data,
#         path='/distributors/'
#     ):
#         return pulp.send(self.request('POST', path=path, data=data))
# 
#     def get_distributor(
#         self,
#         pulp,
#         id,
#     ):
#         path = path_join(GroupDistributor.path, id)
#         with pulp.asserting(True):
#             return GroupDistributor.from_response(pulp.send(self.request('GET', path=path)))
# 
# 
#     def list_distributors(
#         self,
#         pulp,
#     ):
#         path = GroupDistributor.path
#         with pulp.asserting(True):
#             return pulp.send(self.request('GET', path=path)).json()
# 
#     def publish(
#         self,
#         pulp,
#         distributor_group_id,
#         config = None,
#         path='/actions/publish/'
#     ):
#         data={
#             'id': distributor_group_id,
#             'override_config': config
#         }
#         return pulp.send(self.request('POST', path=path, data=data))
# 
# class GroupDistributor(item.AssociatedItem):
#     path = '/distributors/'
#     relevant_data_keys = ['id', 'distributor_type_id', 'repo_group_id', 'config', 'last_publish']


# Path: tests/general_tests/test_04_repo_group_distributors.py
import json
from tests import pulp_test
from pulp_auto.repo_group import RepoGroup, GroupDistributor



def setUpModule():
    pass


class DistributorGroupTest(pulp_test.PulpTest):
    @classmethod
    def setUpClass(cls):
        super(DistributorGroupTest, cls).setUpClass()
        # create repo_group
        repo_group=RepoGroup(data={'id': cls.__name__ + "_repo_group"})
        response=repo_group.create(cls.pulp)

        cls.repo_group = RepoGroup.from_response(response)