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)
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)
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)
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)
def test_tune(): st = scan_task() st.passes = 4 log = LogFile() freq = "test" s = Scanning() with pytest.raises(ValueError): s._frequency_tune(st, freq)
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))
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))
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)
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)
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"])
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)
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)
def test_1_scan(): s=Scanning() st = scan_task() st.mode="boh" with pytest.raises(InvalidScanModeError): s.scan(st)
def test_1_scan(): s = Scanning() st = scan_task() st.mode = "boh" with pytest.raises(InvalidScanModeError): s.scan(st)
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)
def test_terminate(): s = Scanning() s.terminate() assert(s.scan_active == False)
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)
def test_delay(scan_task, FakeSTMessenger): s = Scanning() scan_task.scanq=FakeSTMessenger() s._queue_sleep(scan_task)
def test_terminate(): s = Scanning() s.terminate() assert (s.scan_active == False)
def test_delay(scan_task, FakeSTMessenger): s = Scanning() scan_task.scanq = FakeSTMessenger() s._queue_sleep(scan_task)