Beispiel #1
0
class TestForwardDestinationBuilder(unittest.TestCase):
    def setUp(self):
        self.builder = ForwardDestinationBuilder()

    def test_given_destination_type_forward_then_returns_forward_destination(self):
        dest = {"type": "forward", "forward": "noanswer", "exten": "1000"}

        expected = ForwardDestination(forward="noanswer", exten="1000")

        result = self.builder.build(dest)

        assert_that(result, equal_to(expected))

    def test_given_no_exten_then_returns_forward_destination(self):
        dest = {"type": "forward", "forward": "noanswer"}

        expected = ForwardDestination(forward="noanswer", exten=None)

        result = self.builder.build(dest)

        assert_that(result, equal_to(expected))
Beispiel #2
0
 def setUp(self):
     self.builder = ForwardDestinationBuilder()