예제 #1
0
def test_parse_non_str():
    with pytest.raises(TypeError):
        parser.parse(True)

    with pytest.raises(TypeError):
        parser.parse(1)
예제 #2
0
def test_parse_symbol_rate():
    assert parser.parse('5.120 Msym/sec') == (5120000, 'symbol / second')
    assert parser.parse('2.560 Msym/sec') == (2560000, 'symbol / second')
예제 #3
0
def test_parse_ranging_status():
    with pytest.raises(ValueError):
        parser.parse('Success')
예제 #4
0
def test_parse_power_level():
    assert parser.parse('7 dBmV') == (7, 'dBmV')
    assert parser.parse('-7 dBmV') == (-7, 'dBmV')
예제 #5
0
def test_parse_modulation():
    with pytest.raises(ValueError):
        parser.parse('QAM256')
예제 #6
0
def test_parse_snr():
    assert parser.parse('38 dB') == (38, 'decibel')
예제 #7
0
def test_parse_frequency():
    assert parser.parse('639000000 Hz') == (639000000, 'hertz')
    assert parser.parse('603000000 Hz') == (603000000, 'hertz')
예제 #8
0
def test_parse_bare_int():
    assert parser.parse('15') == (15, 'integer')