Exemplo n.º 1
0
def test_data_processing():
    gps = GPS(debug=1)
    data = GPSData(dictwrapper({'class': 'TPV', 'time': '2010-04-30T11:48:20.10Z', 'lat': 46.498204497,
                                'lon': 7.568061439, 'alt': 1327.689, 'track': 10.3797, 'speed': 0.091,
                                'climb': -0.085}))
    gps.read()
    assert_equal(gps.get_data(), data)
Exemplo n.º 2
0
def test_data_processing():
    gps = GPS(debug=1)
    data = GPSData(
        dictwrapper({
            'class': 'TPV',
            'time': '2010-04-30T11:48:20.10Z',
            'lat': 46.498204497,
            'lon': 7.568061439,
            'alt': 1327.689,
            'track': 10.3797,
            'speed': 0.091,
            'climb': -0.085
        }))
    gps.read()
    assert_equal(gps.get_data(), data)
Exemplo n.º 3
0
def test_create_debug_session():
    gps = GPS(debug=1)
    assert_equal(gps.host, 'localhost')
    assert_equal(gps.port, '2947')
    assert_true(gps.debug)
    assert_false(gps.exit_flag)
    assert_is_none(gps.session)
Exemplo n.º 4
0
def test_thread():
    gps = GPS(debug=1)
    gps.start()
    time.sleep(.2)
    data = GPSData(dictwrapper({'class': 'TPV', 'time': '2010-04-30T11:48:20.10Z', 'lat': 46.498204497,
                                'lon': 7.568061439, 'alt': 1327.689, 'track': 10.3797, 'speed': 0.091,
                                'climb': -0.085}))
    assert_equal(gps.get_data(), data)
    gps.cleanup()
Exemplo n.º 5
0
def test_thread():
    gps = GPS(debug=1)
    gps.start()
    time.sleep(.2)
    data = GPSData(
        dictwrapper({
            'class': 'TPV',
            'time': '2010-04-30T11:48:20.10Z',
            'lat': 46.498204497,
            'lon': 7.568061439,
            'alt': 1327.689,
            'track': 10.3797,
            'speed': 0.091,
            'climb': -0.085
        }))
    assert_equal(gps.get_data(), data)
    gps.cleanup()
Exemplo n.º 6
0
def test_cleanup():
    gps = GPS(debug=1)
    assert_false(gps.exit_flag)
    gps.cleanup()
    assert_true(gps.exit_flag)
Exemplo n.º 7
0
def test_get_instance():
    gps = GPS(debug=1)
    assert_equal(GPS.get_instance(), gps)
    gps2 = GPS(debug=1)
    assert_equal(GPS.get_instance(), gps2)
    assert_not_equal(GPS.get_instance(), gps)
Exemplo n.º 8
0
def test_cleanup():
    gps = GPS(debug=1)
    assert_false(gps.exit_flag)
    gps.cleanup()
    assert_true(gps.exit_flag)
Exemplo n.º 9
0
def test_get_instance():
    gps = GPS(debug=1)
    assert_equal(GPS.get_instance(), gps)
    gps2 = GPS(debug=1)
    assert_equal(GPS.get_instance(), gps2)
    assert_not_equal(GPS.get_instance(), gps)
Exemplo n.º 10
0
def test_create_normal_session():
    GPS()