def _mocked_queue(tmpdir):
    adq = discovery._AutodiscoveryQueue()
    mockdir = Path(tmpdir)
    (mockdir / "most").touch()
    (mockdir / "lost").touch()
    adq._dir = mockdir
    yield adq
 def test_add(self, autodiscovery_queue, monkeypatch):
     autodiscovery_queue = discovery._AutodiscoveryQueue()
     autodiscovery_queue.add("most")
     assert list(autodiscovery_queue.queued_hosts()) == ['most']
 def test_queued_empty(self, autodiscovery_queue, monkeypatch):
     autodiscovery_queue = discovery._AutodiscoveryQueue()
     assert not list(autodiscovery_queue.queued_hosts())
 def test_oldest_empty(self):
     assert discovery._AutodiscoveryQueue().oldest() is None