Exemplo n.º 1
0
    def test_issues_key_exists_and_its_value_is_a_valid_precondition(self):
        data = {
                    'issues': [
                        '/api/v1/issues/1/',
                        '/api/v1/issues/2/',
                        '/api/v1/issues/3/',
                    ]
                }

        from utils.sync.pipes import pissue_precondition

        self.assertIsNone(pissue_precondition(data))
Exemplo n.º 2
0
    def test_invalid_resource_id_must_invalidade_the_precondition(self):
        data = {
                    'issues': [
                        '/api/v1/issues/1/',
                        '/api/v1/issues/bar/',
                        '/api/v1/issues/3/',
                    ]
                }

        from utils.sync.pipes import pissue_precondition
        from utils.sync.pipes import UnmetPrecondition

        self.assertRaises(UnmetPrecondition, lambda: pissue_precondition(data))
Exemplo n.º 3
0
    def test_wrong_endpoint_must_invalidade_the_precondition(self):
        data = {
                    'issues': [
                        '/api/v1/issues/1/',
                        '/api/v1/foo/2/',
                        '/api/v1/issues/3/',
                    ]
                }

        from utils.sync.pipes import pissue_precondition
        from utils.sync.pipes import UnmetPrecondition

        self.assertRaises(UnmetPrecondition, lambda: pissue_precondition(data))