Esempio n. 1
0
    def test_open_specs(self):
        """
        Test the command compiles to the API specification
        """
        
        connector = ElfinderConnector(self.opts)

        #command accepts the specification arguments
        argslist = connector.commandArgsList('open')
        self.assertIn('target', argslist)
        self.assertIn('init', argslist)
        self.assertIn('tree', argslist)
        self.assertIn('mimes', argslist)
        
        #test invalid keyword arguments
        self.assertEqual(ElfinderErrorMessages.ERROR_INV_PARAMS in connector.execute('open')['error'], True)
        
        #test invalid target
        self.assertEqual(ElfinderErrorMessages.ERROR_OPEN in connector.execute('open', target='dummy')['error'], True)
Esempio n. 2
0
    def test_open_specs(self):
        """
        Test the command compiles to the API specification
        """

        connector = ElfinderConnector(self.opts)

        #command accepts the specification arguments
        argslist = connector.commandArgsList('open')
        self.assertIn('target', argslist)
        self.assertIn('init', argslist)
        self.assertIn('tree', argslist)
        self.assertIn('mimes', argslist)

        #test invalid keyword arguments
        self.assertEqual(
            ElfinderErrorMessages.ERROR_INV_PARAMS
            in connector.execute('open')['error'], True)

        #test invalid target
        self.assertEqual(
            ElfinderErrorMessages.ERROR_OPEN
            in connector.execute('open', target='dummy')['error'], True)