コード例 #1
0
ファイル: test_faketime.py プロジェクト: sarosenb/pyfrc
def test_faketime_2():
    '''Test calling the step function '''
    
    ft = FakeTime()
    ft._setup()
    ft.set_time_limit(5)
    
    sc = StepChecker()
    ft._ds_cond._on_step = sc.on_step
    
    ft.increment_new_packet()
    ft.increment_new_packet()
    ft.increment_new_packet()
    
    assert_float(ft.get(), 0.06)
    assert_float(sc.expected, 0.06 + 0.02)
コード例 #2
0
def test_faketime_2():
    '''Test calling the step function '''

    ft = FakeTime()
    ft._setup()
    ft.set_time_limit(5)

    sc = StepChecker()
    ft._ds_cond._on_step = sc.on_step

    ft.increment_new_packet()
    ft.increment_new_packet()
    ft.increment_new_packet()

    assert_float(ft.get(), 0.06)
    assert_float(sc.expected, 0.06 + 0.02)
コード例 #3
0
ファイル: test_faketime.py プロジェクト: yalcins/pyfrc
def test_faketime_2():
    '''Test calling the step function '''

    wpilib.DriverStation._reset()

    ft = FakeTime()
    ft.initialize()
    ft.set_time_limit(5)

    sc = StepChecker()
    ft.ds_cond._on_step = sc.on_step

    ft.increment_new_packet()
    ft.increment_new_packet()
    ft.increment_new_packet()

    assert_float(ft.get(), 0.06)
    assert_float(sc.expected, 0.06 + 0.02)
コード例 #4
0
ファイル: test_faketime.py プロジェクト: sarosenb/pyfrc
def test_faketime_3():
    '''Test calling the step function with varying lengths'''
        
    ft = FakeTime()
    ft._setup()
    ft.set_time_limit(5)
    
    sc = StepChecker()
    ft._ds_cond._on_step = sc.on_step
    
    ft.increment_time_by(0.005)
    ft.increment_time_by(0.01)
    ft.increment_time_by(0.02)
    ft.increment_time_by(0.03)
    ft.increment_time_by(0.04)
    ft.increment_time_by(0.05)
    
    tm = 0.005 + 0.01 + 0.02 + 0.03 + 0.04 + 0.05
    assert_float(ft.get(), tm)
    assert_float(sc.expected, 0.16)
コード例 #5
0
def test_faketime_3():
    '''Test calling the step function with varying lengths'''

    ft = FakeTime()
    ft._setup()
    ft.set_time_limit(5)

    sc = StepChecker()
    ft._ds_cond._on_step = sc.on_step

    ft.increment_time_by(0.005)
    ft.increment_time_by(0.01)
    ft.increment_time_by(0.02)
    ft.increment_time_by(0.03)
    ft.increment_time_by(0.04)
    ft.increment_time_by(0.05)

    tm = 0.005 + 0.01 + 0.02 + 0.03 + 0.04 + 0.05
    assert_float(ft.get(), tm)
    assert_float(sc.expected, 0.16)
コード例 #6
0
ファイル: test_faketime.py プロジェクト: warrenlp/pyfrc
def test_faketime_3():
    """Test calling the step function with varying lengths"""

    wpilib.DriverStation._reset()

    ft = FakeTime()
    ft.initialize()
    ft.set_time_limit(5)

    sc = StepChecker()
    ft.ds_cond._on_step = sc.on_step

    ft.increment_time_by(0.005)
    ft.increment_time_by(0.01)
    ft.increment_time_by(0.02)
    ft.increment_time_by(0.03)
    ft.increment_time_by(0.04)
    ft.increment_time_by(0.05)

    tm = 0.005 + 0.01 + 0.02 + 0.03 + 0.04 + 0.05
    assert_float(ft.get(), tm)
    assert_float(sc.expected, 0.16)