Exemplo n.º 1
0
    def setUpAll(self, mode=None):
        self.log = support.logger()
        self.log.info("%s started", self.__module__)

        self.start_fds = len(support.find_open_fds())

        self.log.info("%d files open before watch started", self.start_fds)
        if not os.path.isdir(working_dir):
            os.mkdir(working_dir, 0x1FF)
        self.module_list = []
        self.file_list = []
        self.change_target = None
        prev_module = None
        for fname in reversed(test_modules):
            path = os.path.join(working_dir, fname + '.py')
            self.test_module = path
            with open(path, 'w') as f:
                if prev_module:
                    f.write("import " + prev_module + "\n")
                prev_module = fname
                f.write(module_content)
                f.close()
            self.module_list.append(path)
            if self.change_target is None:
                self.change_target = path
            self.file_list.append(path)
            self.file_list.append(path + 'c')
        self.module_path = os.path.join(env.test_dir, self.__module__)
Exemplo n.º 2
0
    def setUpAll(self, mode=None):
        self.log = support.logger()
        self.log.info("%s started", self.__module__)

        self.pset = taskforce.poll.poll()
        if mode is not None:
            self.pset.set_mode(mode)

        self.log.info("Using mode %s of available %s", self.pset.get_mode_name(), self.pset.get_available_mode_names())

        #  Run basic test using a self pipe
        self.rd, self.wd = os.pipe()
Exemplo n.º 3
0
    def setUpAll(self, mode=None):
        self.log = support.logger()
        self.log.info("%s started", self.__module__)

        self.start_fds = len(support.find_open_fds())

        self.log.info("%d files open before watch started", self.start_fds)
        self.file_list = []
        for fname in base_file_list:
            path = os.path.join(env.temp_dir, fname)
            with open(path, 'w') as f:
                f.write(path + '\n')
                self.file_list.append(path)
Exemplo n.º 4
0
    def setUpAll(self, mode=None):
        self.log = support.logger()
        self.log.info("%s started", self.__module__)

        self.start_fds = len(support.find_open_fds())

        self.log.info("%d files open before watch started", self.start_fds)
        self.file_list = []
        for fname in base_file_list:
            path = os.path.join(env.temp_dir, fname)
            with open(path, 'w') as f:
                f.write(path + '\n')
                self.file_list.append(path)
Exemplo n.º 5
0
    def setUpAll(self, mode=None):
        self.log = support.logger()
        self.log.info("%s started", self.__module__)

        self.pset = taskforce.poll.poll()
        if mode is not None:
            self.pset.set_mode(mode)

        self.log.info("Using mode %s of available %s",
                      self.pset.get_mode_name(),
                      self.pset.get_available_mode_names())

        #  Run basic test using a self pipe
        self.rd, self.wd = os.pipe()
Exemplo n.º 6
0
    def setUpAll(self):
        self.log = support.logger()
        self.log.info("%s started", self.__module__)

        self.start_fds = len(support.find_open_fds())
        self.startenv = {}
        self.delenv = []
        for tag in ['PATH', 'PYTHONPATH', 'EXAMPLES_BASE']:
            if tag in os.environ:
                self.startenv[tag] = os.environ[tag]
            else:
                self.delenv.append(tag)

        self.log.info("%d files open before task testing", self.start_fds)
        self.file_list = [env.roles_file]
Exemplo n.º 7
0
 def setUpAll(self, mode=None):
     self.log = support.logger()
     self.log.info("%s started", self.__module__)
Exemplo n.º 8
0
 def __init__(self):
     here = my()
     support.logger().info("%s at class init level", here)
     assert here.startswith('my_class_init()')
Exemplo n.º 9
0
def my_module_level():
    here = my()
    support.logger().info("%s at module level", here)
    assert here.startswith('test_01_utils.my_module_level()')