def test_save_and_delete_one_value(self, adhsserver): c = AdhsClient() c.connectToServer('ipc://testserver.sock') c.save('/bla', 'BLUB') assert c.get('/bla') == 'BLUB' c.delete('/bla') assert c.has_key('/bla') == False
def test_save_one_value(self, adhsserver): c = AdhsClient() c.connectToServer('ipc://testserver.sock') c.save('/bla', 'BLUB BLOB') assert len(adhsserver.known_hashes()) == 1
def test_save_and_get_one_value(self, adhsserver): c = AdhsClient() c.connectToServer('ipc://testserver.sock') c.save('/bla', 'BLUB BLOB') assert c.get('/bla') == 'BLUB BLOB'
def test_search_existing_key(self, adhsserver): c = AdhsClient() c.connectToServer('ipc://testserver.sock') c.save('/bla', 'BLUB') assert c.has_key('/bla') == True assert c.has_key('/blub') == False
def test_search_non_existing_key(self, adhsserver): c = AdhsClient() c.connectToServer('ipc://testserver.sock') assert c.has_key('/bla') == False
def test_get_not_existing_value(self, adhsserver): c = AdhsClient() c.connectToServer('ipc://testserver.sock') with pytest.raises(KeyError): c.get('/bla')
def test_start_one_server(self, adhsserver): c = AdhsClient() c.connectToServer('ipc://testserver.sock') assert len(c.active_servers()) == 1 assert len(adhsserver.known_hashes()) == 0
def test_reach_zero_servers(self): '''As no server is started, asking the number of servers should be 0''' c = AdhsClient() assert len(c.active_servers()) == 0