How to use the jira.resources.cls_for_resource function in jira

To help you get started, we’ve selected a few jira examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pycontribs / jira / tests / tests.py View on Github external
def test_cls_for_resource(self):
        self.assertEqual(
            cls_for_resource(
                "https://jira.atlassian.com/rest/\
                api/latest/issue/JRA-1330"
            ),
            Issue,
        )
        self.assertEqual(
            cls_for_resource(
                "http://localhost:2990/jira/rest/\
                api/latest/project/BULK"
            ),
            Project,
        )
        self.assertEqual(
            cls_for_resource(
                "http://imaginary-jira.com/rest/\
                api/latest/project/IMG/role/10002"
            ),
            Role,
        )
        self.assertEqual(
            cls_for_resource(
                "http://customized-jira.com/rest/\
                plugin-resource/4.5/json/getMyObject"
github pycontribs / jira / tests / tests.py View on Github external
def test_cls_for_resource(self):
        self.assertEqual(cls_for_resource('https://jira.atlassian.com/rest/\
                api/latest/issue/JRA-1330'), Issue)
        self.assertEqual(cls_for_resource('http://localhost:2990/jira/rest/\
                api/latest/project/BULK'), Project)
        self.assertEqual(cls_for_resource('http://imaginary-jira.com/rest/\
                api/latest/project/IMG/role/10002'), Role)
        self.assertEqual(cls_for_resource('http://customized-jira.com/rest/\
                plugin-resource/4.5/json/getMyObject'), Resource)
github pycontribs / jira / tests / tests.py View on Github external
self.assertEqual(
            cls_for_resource(
                "http://imaginary-jira.com/rest/\
                api/latest/project/IMG/role/10002"
            ),
            Role,
        )
        self.assertEqual(
            cls_for_resource(
                "http://customized-jira.com/rest/\
                plugin-resource/4.5/json/getMyObject"
            ),
            UnknownResource,
        )
        self.assertEqual(
            cls_for_resource(
                "http://customized-jira.com/rest/\
                group?groupname=bla"
            ),
            Group,
        )
github pycontribs / jira / tests / tests.py View on Github external
def test_pickling_resource(self):
        resource = self.jira.find('issue/{0}',
                                  self.test_manager.project_b_issue1)

        pickled = pickle.dumps(resource.raw)
        unpickled = pickle.loads(pickled)
        cls = cls_for_resource(unpickled['self'])
        unpickled_instance = cls(self.jira._options, self.jira._session, raw=pickle.loads(pickled))
        self.assertEqual(resource.key, unpickled_instance.key)
        self.assertTrue(resource == unpickled_instance)
github pycontribs / jira / tests / tests.py View on Github external
def test_cls_for_resource(self):
        self.assertEqual(cls_for_resource('https://jira.atlassian.com/rest/\
                api/latest/issue/JRA-1330'), Issue)
        self.assertEqual(cls_for_resource('http://localhost:2990/jira/rest/\
                api/latest/project/BULK'), Project)
        self.assertEqual(cls_for_resource('http://imaginary-jira.com/rest/\
                api/latest/project/IMG/role/10002'), Role)
        self.assertEqual(cls_for_resource('http://customized-jira.com/rest/\
                plugin-resource/4.5/json/getMyObject'), Resource)
github pycontribs / jira / tests / tests.py View on Github external
def test_pickling_resource(self):
        resource = self.jira.find("issue/{0}", self.test_manager.project_b_issue1)

        pickled = pickle.dumps(resource.raw)
        unpickled = pickle.loads(pickled)
        cls = cls_for_resource(unpickled["self"])
        unpickled_instance = cls(
            self.jira._options, self.jira._session, raw=pickle.loads(pickled)
        )
        self.assertEqual(resource.key, unpickled_instance.key)
        self.assertTrue(resource == unpickled_instance)
github pycontribs / jira / tests / tests.py View on Github external
def test_cls_for_resource(self):
        self.assertEqual(cls_for_resource('https://jira.atlassian.com/rest/\
                api/latest/issue/JRA-1330'), Issue)
        self.assertEqual(cls_for_resource('http://localhost:2990/jira/rest/\
                api/latest/project/BULK'), Project)
        self.assertEqual(cls_for_resource('http://imaginary-jira.com/rest/\
                api/latest/project/IMG/role/10002'), Role)
        self.assertEqual(cls_for_resource('http://customized-jira.com/rest/\
                plugin-resource/4.5/json/getMyObject'), Resource)
github pycontribs / jira / tests / tests.py View on Github external
self.assertEqual(
            cls_for_resource(
                "https://jira.atlassian.com/rest/\
                api/latest/issue/JRA-1330"
            ),
            Issue,
        )
        self.assertEqual(
            cls_for_resource(
                "http://localhost:2990/jira/rest/\
                api/latest/project/BULK"
            ),
            Project,
        )
        self.assertEqual(
            cls_for_resource(
                "http://imaginary-jira.com/rest/\
                api/latest/project/IMG/role/10002"
            ),
            Role,
        )
        self.assertEqual(
            cls_for_resource(
                "http://customized-jira.com/rest/\
                plugin-resource/4.5/json/getMyObject"
            ),
            UnknownResource,
        )
        self.assertEqual(
            cls_for_resource(
                "http://customized-jira.com/rest/\
                group?groupname=bla"
github pycontribs / jira / tests / tests.py View on Github external
def test_cls_for_resource(self):
        self.assertEqual(cls_for_resource('https://jira.atlassian.com/rest/\
                api/latest/issue/JRA-1330'), Issue)
        self.assertEqual(cls_for_resource('http://localhost:2990/jira/rest/\
                api/latest/project/BULK'), Project)
        self.assertEqual(cls_for_resource('http://imaginary-jira.com/rest/\
                api/latest/project/IMG/role/10002'), Role)
        self.assertEqual(cls_for_resource('http://customized-jira.com/rest/\
                plugin-resource/4.5/json/getMyObject'), Resource)
github pycontribs / jira / tests / tests.py View on Github external
def test_cls_for_resource(self):
        self.assertEqual(
            cls_for_resource(
                "https://jira.atlassian.com/rest/\
                api/latest/issue/JRA-1330"
            ),
            Issue,
        )
        self.assertEqual(
            cls_for_resource(
                "http://localhost:2990/jira/rest/\
                api/latest/project/BULK"
            ),
            Project,
        )
        self.assertEqual(
            cls_for_resource(
                "http://imaginary-jira.com/rest/\
                api/latest/project/IMG/role/10002"