Esempio n. 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 ()')
Esempio n. 2
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]')
Esempio n. 3
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 ()')
Esempio n. 4
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]')
Esempio n. 5
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')
Esempio n. 6
0
    def testObjectMethod (self):
        single, combined= castt.func_name2dotted_exec (parse_expression ('".".join ([])'))

        self.assertEqual (single, None)
        self.assertEqual (combined, None)
Esempio n. 7
0
    def testObjectMethod(self):
        single, combined = castt.func_name2dotted_exec(
            parse_expression('".".join ([])'))

        self.assertEqual(single, None)
        self.assertEqual(combined, None)
Esempio n. 8
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')