예제 #1
0
    def test_sections_key_exists_and_its_value_is_a_valid_precondition(self):
        data = {
            'sections': '',
        }

        from utils.sync.pipes import psection_precondition

        self.assertIsNone(psection_precondition(data))
예제 #2
0
    def test_invalid_resource_id_must_invalidade_the_precondition(self):
        data = {
            'sections': [
                '/api/v1/sections/514/',
                '/api/v1/sections/baz/',
                '/api/v1/sections/516/',
            ]
        }

        from utils.sync.pipes import psection_precondition
        from utils.sync.pipes import UnmetPrecondition

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