示例#1
0
    def testListingKeys(self):
        q = Quickly(self.path)
        q.add('javascript', os.path.dirname(self.path))
        q.add('php', os.path.dirname(self.path))
        q.add('python', os.path.dirname(self.path))
        q.sync()

        keys = q.listKeys()
        self.assertEqual(len(keys), 3)
示例#2
0
    def testList(self):
        q = Quickly(self.path)
        q.add('javascript', os.path.dirname(self.path))
        q.add('php', os.path.dirname(self.path))
        q.add('python', os.path.dirname(self.path))
        q.sync()

        ls = q.list()
        self.assertEqual(ls['php'], os.path.dirname(self.path))
        self.assertEqual(ls['javascript'], os.path.dirname(self.path))
        self.assertEqual(ls['python'], os.path.dirname(self.path))
示例#3
0
    def testUpdate(self):
        q = Quickly(self.path)
        q.add('javascript', os.path.dirname(self.path))
        q.add('php', os.path.dirname(self.path))
        q.add('python', os.path.dirname(self.path))
        q.sync()

        q = Quickly(self.path)
        q.edit('php', os.path.expanduser('~'))
        q.sync()

        q = Quickly(self.path)
        self.assertTrue('php' in q.config['PATH'])
        self.assertEqual(q.config['PATH']['php'], os.path.expanduser('~'))
示例#4
0
    def testSyncing(self):
        q = Quickly(self.path)
        q.add('javascript', os.path.dirname(self.path))
        q.add('php', os.path.dirname(self.path))
        q.add('python', os.path.dirname(self.path))

        self.assertTrue('python' in q.config['PATH'])

        q.remove('php')
        q.sync()

        q2 = Quickly(self.path)
        self.assertTrue('python' in q2.config['PATH'])
        self.assertTrue('javascript' in q2.config['PATH'])
示例#5
0
    def testDeletingKey(self):
        q = Quickly(self.path)
        q.add('javascript', os.path.dirname(self.path))
        q.add('php', os.path.dirname(self.path))
        q.add('python', os.path.dirname(self.path))

        self.assertTrue('python' in q.config['PATH'])

        # now delete something
        q.remove('php')
        self.assertFalse('php' in q.config['PATH'])
        self.assertTrue('python' in q.config['PATH'])
        q.sync()

        q2 = Quickly(self.path)
        self.assertFalse('php' in q2.config['PATH'])
        self.assertTrue('python' in q2.config['PATH'])
        q2.remove('python')
        q2.sync()

        q3 = Quickly(self.path)
        self.assertFalse('php' in q3.config['PATH'])
        self.assertFalse('python' in q3.config['PATH'])
示例#6
0
    def testSettingCurrentDirectoryAsDot(self):
        q = Quickly(self.path)
        os.chdir(os.path.expanduser('~'))
        q.add('javascript', '.')

        self.assertEqual(q.config['PATH']['javascript'], os.path.expanduser('~'))
示例#7
0
    def testSettingExistingPath(self):
        q = Quickly(self.path)
        q.add('javascript', os.path.dirname(self.path))

        self.assertTrue(q.config['PATH']['javascript'], os.path.dirname(self.path))