def read(self, path, encoding=None): """ Read the template at the given path, and return it as a unicode string. """ b = common.read(path) if encoding is None: encoding = self.file_encoding return self.unicode(b, encoding)
def read(self, path, encoding=None): """ Read the template at the given path, and return it as a unicode string. """ b = common.read(path) if encoding is None: encoding = self.file_encoding return self.str(b, encoding)
def read(self, path, encoding=None): """ Read the template at the given path, and return it as a unicode string. """ b = common.read(path) if encoding is None: encoding = self.file_encoding if platform.system() == 'Windows': return self.str(b, encoding).replace('\r', '') return self.str(b, encoding)
def _read_spec_tests(path): """ Return a list of unittest.TestCase instances. """ b = common.read(path) u = str(b, encoding=FILE_ENCODING) spec_data = parse(u) tests = spec_data['tests'] cases = [] for data in tests: case = _deserialize_spec_test(data, path) cases.append(case)
def _read_spec_tests(path): """ Return a list of unittest.TestCase instances. """ b = common.read(path) u = str(b, encoding=FILE_ENCODING) spec_data = parse(u) tests = spec_data['tests'] cases = [] for data in tests: case = _deserialize_spec_test(data, path) cases.append(case) return cases