Example #1
0
    def testDottedCall (self):
        single, combined= castt.func_name2dotted_exec (parse_expression ('str (foo).strip ()'))

        self.assertEqual (single, 'str')
        # this is a very strange but possible executable name
        self.assertEqual (combined, 'str (foo, ).strip ()')
Example #2
0
    def testDottedDottedName (self):
        single, combined= castt.func_name2dotted_exec (parse_expression ('test.me.py'))

        self.assertEqual (single, 'test')
        self.assertEqual (combined, 'test.me.py')
Example #3
0
    def testDottedSubscriptComplex (self):
        single, combined= castt.func_name2dotted_exec (parse_expression ('argv[3].split[:54]'))

        self.assertEqual (single, 'argv')
        # this is a very strange but possible executable name
        self.assertEqual (combined, 'argv[3].split[:54]')
Example #4
0
    def testObjectMethod (self):
        single, combined= castt.func_name2dotted_exec (parse_expression ('".".join ([])'))

        self.assertEqual (single, None)
        self.assertEqual (combined, None)