Beispiel #1
0
    def __init__(self, parent, test_file_path, po_class, load_file=False):
        PyFileUI.__init__(self, parent, test_file_path, load_file)

        self.__po_class = po_class

        if not load_file:
            initial_text = self.TEST_FILE_TEMPLATE.format(
                class_name=get_class_name_from_file(test_file_path),
                url=po_class.url)
            self.txt_content.SetValue(initial_text)
Beispiel #2
0
    def __init__(self, parent, test_file_path,
                 po_class, load_file=False):
        PyFileUI.__init__(self, parent, test_file_path, load_file)

        self.__po_class = po_class

        if not load_file:
            initial_text = self.TEST_FILE_TEMPLATE.format(
                class_name=get_class_name_from_file(test_file_path),
                url=po_class.url
            )
            self.txt_content.SetValue(initial_text)
Beispiel #3
0
    def test_get_class_name_from_file(self):
        class_name = get_class_name_from_file('my_test.py')
        self.assertEqual(class_name, 'MyTest')

        class_name = get_class_name_from_file('/tmp/my_test.py')
        self.assertEqual(class_name, 'MyTest')