mirror of
https://github.com/wting/autojump
synced 2026-03-02 03:49:26 +00:00
adding option to decrease weight
added a new option, -d/--decrease to decrease the weight of a path. added --increase as an alias to --add for symetry.
This commit is contained in:
@@ -53,6 +53,15 @@ class TestAutojump(unittest.TestCase):
|
||||
self.db.add('/2', 10)
|
||||
self.assertEqual(self.db.get_weight('/2'), 14.142135623730951)
|
||||
|
||||
def test_db_decrease(self):
|
||||
self.db.add('/1', 100)
|
||||
self.db.decrease('/a', 42)
|
||||
self.assertTrue(self.db.get_weight('/a') < 100)
|
||||
self.db.add('/2', 100)
|
||||
self.db.add('/2', 42)
|
||||
self.db.decrease('/2', 42)
|
||||
self.assertEquals(self.db.get_weight('/2'), 100)
|
||||
|
||||
def test_db_get_weight(self):
|
||||
self.assertEqual(self.db.get_weight('/'), 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user