Example #1
0
 def test_get_class_name(self):
     js_path = 'C:\\Users\\Donecro\\Project\\Py Cli\\code_cli\\resource\\'
     js_name = 'employee.js'
     js_str = js_util.get_js_str(js_path, js_name)
     class_name = js_util.get_class_name(js_str)
     print(class_name + '\n')
     self.assertTrue('FOO'.isupper())
Example #2
0
 def test_get_constructor_content(self):
     js_path = 'C:\\Users\\Donecro\\Project\\Py Cli\\code_cli\\resource\\'
     js_name = 'employee.js'
     js_str = js_util.get_js_str(js_path, js_name)
     inner_str = js_util.get_class_inner_str(js_str)
     constructor_content = js_util.get_constructor_content(inner_str)
     print(constructor_content + '\n')
     self.assertTrue('FOO'.isupper())
Example #3
0
def test_get_class_name(c_path, c_name):
    """
    >>> test_get_class_name(js_path, js_name)
    'Employee'
    """
    js_str = js_util.get_js_str(c_path, c_name)
    class_name = js_util.get_class_name(js_str)
    return class_name
Example #4
0
def test_get_method_list(c_path, c_name):
    """
    >>> test_get_method_list(js_path, js_name)
    ['desc()', 'call()']
    """
    js_str = js_util.get_js_str(c_path, c_name)
    inner_str = js_util.get_class_inner_str(js_str)
    method_list = js_util.get_method_list(inner_str)
    return method_list
Example #5
0
def test_get_field_list(c_path, c_name):
    """
    >>> test_get_field_list(js_path, js_name)
    ['name', 'age', 'gender']
    """
    js_str = js_util.get_js_str(c_path, c_name)
    inner_str = js_util.get_class_inner_str(js_str)
    field_list = js_util.get_field_list(inner_str)
    return field_list
Example #6
0
def test_get_constructor_content(c_path, c_name):
    """
    >>> test_get_constructor_content(js_path, js_name)
    'constructor(name, age, gender)'
    """
    js_str = js_util.get_js_str(c_path, c_name)
    inner_str = js_util.get_class_inner_str(js_str)
    constructor_content = js_util.get_constructor_content(inner_str)
    return constructor_content
Example #7
0
 def test_get_method_list(self):
     js_path = 'C:\\Users\\Donecro\\Project\\Py Cli\\code_cli\\resource\\'
     js_name = 'employee.js'
     js_str = js_util.get_js_str(js_path, js_name)
     inner_str = js_util.get_class_inner_str(js_str)
     method_list = js_util.get_method_list(inner_str)
     for item in method_list:
         print(item, end=' ')
     print('\n')
     self.assertTrue('FOO'.isupper())
Example #8
0
 def execute(self, args):
     js_str = js_util.get_js_str(get_current_path(), set_js_name(args[0]))
     return "-------------------- START --------------------\n" + js_str +\
            '\n-------------------- END --------------------'