def test_speed(self):
        # Speed is simply sqrt(u^2 + v^2)
        u = 2
        v = 2

        speed, direction = calculate_speed_direction(u, v)

        self.assertAlmostEqual(2.8284271, speed)
        # Wind should be from the southwest
        self.assertTrue(180 < direction < 270)
    def test_dir_from_west(self):
        # Positive u means wind is blowing to the East
        u = 1
        v = 0

        speed, direction = calculate_speed_direction(u, v)

        # Degrees are where the wind is blowing from (relative to true North)
        self.assertEqual(1, speed)
        # Wind from West (270 degrees)
        self.assertEqual(270, direction)
    def test_dir_from_east(self):
        # Negative u means wind is blowing to the West
        u = -1
        v = 0

        speed, direction = calculate_speed_direction(u, v)

        # Degrees are where the wind is blowing from (relative to true North)
        self.assertEqual(1, speed)
        # Wind from East (90 degrees)
        self.assertEqual(90, direction)
    def test_dir_from_south(self):
        # Positive v means wind is blowing to the North
        u = 0
        v = 1

        speed, direction = calculate_speed_direction(u, v)

        # Degrees are where the wind is blowing from (relative to true North)
        self.assertEqual(1, speed)
        # Wind from South (180 degrees)
        self.assertEqual(180, direction)
    def test_dir_from_north(self):
        # Negative v means wind is wind blowing to the South
        u = 0
        v = -1

        speed, direction = calculate_speed_direction(u, v)

        # Degrees are where the wind is blowing from (relative to true North)
        self.assertEqual(1, speed)
        # Wind from North (0 degrees)
        self.assertEqual(0, direction)