Completed
Pull Request — master (#304)
by
unknown
01:14
created

test_mapper_len()   A

Complexity

Conditions 2

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
c 1
b 0
f 0
dl 0
loc 3
rs 10
1
# Copyright (c) 2008-2015 MetPy Developers.
2
# Distributed under the terms of the BSD 3-Clause License.
3
# SPDX-License-Identifier: BSD-3-Clause
4
"""Tests for the `wx_symbols` module."""
5
from metpy.plots.wx_symbols import current_weather
6
7
8
def test_mapper():
9
    """Test for symbol mapping functionality."""
10
    assert current_weather(0) == ''
11
    assert current_weather(4) == u'\ue9a2'
12
    assert current_weather(7) == u'\ue9a5'
13
    assert current_weather(65) == u'\ue9e1'
14
15
16
def test_alt_char():
17
    """Test alternate character functionality for mapper."""
18
    assert current_weather.alt_char(7, 1) == u'\ue9a6'
19
    assert current_weather.alt_char(7, 2) == u'\ue9a7'
20
21
22
def test_mapper_len():
23
    """Test getting the length of the mapper."""
24
    assert len(current_weather) == 100
25