Exemple #1
0
 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
Exemple #2
0
 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'
Exemple #3
0
 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
Exemple #4
0
 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
Exemple #5
0
 def test_search_non_existing_key(self, adhsserver):
     c = AdhsClient()
     c.connectToServer('ipc://testserver.sock')
     assert c.has_key('/bla') == False
Exemple #6
0
 def test_get_not_existing_value(self, adhsserver):
     c = AdhsClient()
     c.connectToServer('ipc://testserver.sock')
     with pytest.raises(KeyError):
         c.get('/bla')
Exemple #7
0
 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