コード例 #1
0
    def test_per_task_instructions_with_underscores_formatted_correctly(self):
        test_task = Task()
        test_task.x = 1
        test_task.y = 2
        test_task.zoom = 3
        test_task.is_square = True

        # Act
        instructions = test_task.format_per_task_instructions(
            "Test Url is http://test.com/{x}_{y}_{z}")

        # Assert
        self.assertEqual(instructions, "Test Url is http://test.com/1_2_3")
コード例 #2
0
    def test_per_task_instructions_formatted_correctly(self):
        # Arrange
        test_task = Task()
        test_task.x = 1
        test_task.y = 2
        test_task.zoom = 3
        test_task.is_square = True

        # Act
        instructions = test_task.format_per_task_instructions(
            "Test Url is http://test.com/{x}/{y}/{z}")

        # Assert
        self.assertEqual(instructions, "Test Url is http://test.com/1/2/3")
コード例 #3
0
    def test_per_task_instructions_returns_instructions_when_no_dynamic_url_and_task_not_splittable(
        self, ):
        # Arrange
        test_task = Task()
        test_task.x = 1
        test_task.y = 2
        test_task.zoom = 3
        test_task.is_square = False

        # Act
        instructions = test_task.format_per_task_instructions("Use map box")

        # Assert
        self.assertEqual(instructions, "Use map box")
コード例 #4
0
    def test_per_task_instructions_returns_instructions_with_extra_properties(
            self):
        # Arrange
        test_task = Task()
        test_task.extra_properties = '{"foo": "bar"}'
        test_task.x = 1
        test_task.y = 2
        test_task.zoom = 3
        test_task.is_square = True

        # Act
        instructions = test_task.format_per_task_instructions(
            "Foo is replaced by {foo}")

        # Assert
        self.assertEqual(instructions, "Foo is replaced by bar")