Exemplo n.º 1
0
def test_signal_check(fake_rig):
    s = Scanning()
    st = scan_task()
    st.rig = fake_rig
    sgn_level = 2
    detected_level = []
    assert (s._signal_check(sgn_level, fake_rig, detected_level) == True)
Exemplo n.º 2
0
def test_signal_check(fake_rig):
    s = Scanning()
    st = scan_task()
    st.rig = fake_rig
    sgn_level = 2
    detected_level = []
    assert( s._signal_check( sgn_level, fake_rig, detected_level) == True)
Exemplo n.º 3
0
def test_new_bookmarks_2(fake_rig):
    s = Scanning()
    st = scan_task()
    st.rig = fake_rig
    freq = st.params["range_min"]
    nbm = s._create_new_bookmark(st, freq)
    assert(isinstance(nbm, dict) == True)
Exemplo n.º 4
0
def test_new_bookmarks_2(fake_rig):
    s = Scanning()
    st = scan_task()
    st.rig = fake_rig
    freq = st.params["range_min"]
    nbm = s._create_new_bookmark(st, freq)
    assert (isinstance(nbm, dict) == True)
Exemplo n.º 5
0
def test_tune():
    st = scan_task()
    st.passes = 4
    log = LogFile()
    freq = "test"
    s = Scanning()
    with pytest.raises(ValueError):
        s._frequency_tune(st, freq)
Exemplo n.º 6
0
def test_tune():
    st = scan_task()
    st.passes = 4
    log = LogFile()
    freq = "test"
    s = Scanning()
    with pytest.raises(ValueError):
        s._frequency_tune(st, freq)
Exemplo n.º 7
0
def test_new_bookmarks_1(fake_rig):
    st = scan_task()
    st.rig = fake_rig
    freq = st.params["range_min"]
    s = Scanning()
    original_len = len(st.new_bookmark_list)
    nbm = s._create_new_bookmark(st, freq)
    st.new_bookmark_list.append(nbm)
    assert (original_len + 1 == len(st.new_bookmark_list))
Exemplo n.º 8
0
def test_new_bookmarks_1(fake_rig):
    st = scan_task()
    st.rig = fake_rig
    freq = st.params["range_min"]
    s = Scanning()
    original_len = len(st.new_bookmark_list)
    nbm = s._create_new_bookmark(st, freq)
    st.new_bookmark_list.append(nbm)
    assert(original_len + 1 == len(st.new_bookmark_list))
Exemplo n.º 9
0
def test_2_tune():
    st = scan_task()
    st.passes = 4
    log = LogFile()
    freq = st.params["range_min"]
    s = Scanning()
    try:
        s._frequency_tune(st, freq)
    except Exception:
        pass
    assert (s.scan_active == False)
Exemplo n.º 10
0
def test_2_tune():
    st = scan_task()
    st.passes = 4
    log = LogFile()
    freq = st.params["range_min"]
    s = Scanning()
    try:
        s._frequency_tune(st, freq)
    except Exception:
        pass
    assert (s.scan_active == False)
Exemplo n.º 11
0
def test_queue_sleep_2(scan_task):
    # sillt test just to make sure that the while true actually ends.
    s = Scanning()
    scan_task.params['delay'] = "test"
    with pytest.raises(ValueError):
        s._queue_sleep(scan_task)
Exemplo n.º 12
0
def test_get_scan_items(scan_task):
    s = Scanning()
    freq, pass_count, interval = s._get_task_items(scan_task)
    assert (freq == scan_task.params["range_min"])
    assert (pass_count == scan_task.params["passes"])
Exemplo n.º 13
0
def test_queue_sleep_1(scan_task,FakeSTMessenger):
    # sillt test just to make sure that the while true actually ends.
    s = Scanning()
    scan_task.params['delay'] = 1
    scan_task.scanq=FakeSTMessenger()
    s._queue_sleep(scan_task)
Exemplo n.º 14
0
def test_get_scan_items(scan_task):
    s = Scanning()
    freq, pass_count, interval = s._get_task_items(scan_task)
    assert (freq == scan_task.params["range_min"])
    assert (pass_count == scan_task.params["passes"])
Exemplo n.º 15
0
def test_pass_count_update(scan_task):
    s=Scanning()
    s.scan_active=True
    scan_task.params["passes"]=2
    n,task = s._pass_count_update(1,scan_task)
    assert(s.scan_active == False)
Exemplo n.º 16
0
def test_1_scan():
    s=Scanning()
    st = scan_task()
    st.mode="boh"
    with pytest.raises(InvalidScanModeError):
        s.scan(st)
Exemplo n.º 17
0
def test_1_scan():
    s = Scanning()
    st = scan_task()
    st.mode = "boh"
    with pytest.raises(InvalidScanModeError):
        s.scan(st)
Exemplo n.º 18
0
def test_queue_sleep_2(scan_task):
    # sillt test just to make sure that the while true actually ends.
    s = Scanning()
    scan_task.params['delay'] = "test"
    with pytest.raises(ValueError):
        s._queue_sleep(scan_task)
Exemplo n.º 19
0
def test_pass_count_update(scan_task):
    s = Scanning()
    s.scan_active = True
    scan_task.params["passes"] = 2
    n, task = s._pass_count_update(1, scan_task)
    assert (s.scan_active == False)
Exemplo n.º 20
0
def test_terminate():
    s = Scanning()
    s.terminate()
    assert(s.scan_active == False)
Exemplo n.º 21
0
def test_queue_sleep_1(scan_task, FakeSTMessenger):
    # sillt test just to make sure that the while true actually ends.
    s = Scanning()
    scan_task.params['delay'] = 1
    scan_task.scanq = FakeSTMessenger()
    s._queue_sleep(scan_task)
Exemplo n.º 22
0
def test_delay(scan_task, FakeSTMessenger):
    s = Scanning()
    scan_task.scanq=FakeSTMessenger()
    s._queue_sleep(scan_task)
Exemplo n.º 23
0
def test_terminate():
    s = Scanning()
    s.terminate()
    assert (s.scan_active == False)
Exemplo n.º 24
0
def test_delay(scan_task, FakeSTMessenger):
    s = Scanning()
    scan_task.scanq = FakeSTMessenger()
    s._queue_sleep(scan_task)