Example #1
0
        """
        with ReaderSequence(self.reader, *self.streams) as sequence:
            self.assertSequenceEqual(self.records, list(sequence))
        self.assertTrue(all(stream.closed for stream in self.streams))
        return
        

# Specify the test cases to run for this module (disables automatic discovery).

_TEST_CASES = (DelimitedReaderTest, FixedWidthReaderTest, ReaderSequenceTest)

def load_tests(loader, tests, pattern):
    """ Define a TestSuite for this module.

    This is part of the unittest API. The last two arguments are ignored. The
    _TEST_CASES global is used to determine which TestCase classes to load
    from this module.

    """
    suite = unittest.TestSuite()
    for test_case in _TEST_CASES:
        tests = loader.loadTestsFromTestCase(test_case)
        suite.addTests(tests)
    return suite


# Make the module executable.

if __name__ == "__main__":
    unittest.main()  # main() calls sys.exit()
Example #2
0
        regex = r"abc|def"
        self.whitelist = TextFilter(regex)
        self.blacklist = TextFilter(regex, False)
        self.data = ["abc\n", "def\n", "ghi\n"]
        return

        
# Specify the test cases to run for this module (disables automatic discovery).

_TEST_CASES = (FieldFilterTest, TextFilterTest)

def load_tests(loader, tests, pattern):
    """ Define a TestSuite for this module.

    This is part of the unittest API. The last two arguments are ignored. The
    _TEST_CASES global is used to determine which TestCase classes to load
    from this module.

    """
    suite = unittest.TestSuite()
    for test_case in _TEST_CASES:
        tests = loader.loadTestsFromTestCase(test_case)
        suite.addTests(tests)
    return suite


# Make the module executable.

if __name__ == "__main__":
    unittest.main()  # this calls exit()
Example #3
0
        with ReaderSequence(self.reader, *self.streams) as sequence:
            self.assertSequenceEqual(self.records, list(sequence))
        self.assertTrue(all(stream.closed for stream in self.streams))
        return


# Specify the test cases to run for this module (disables automatic discovery).

_TEST_CASES = (DelimitedReaderTest, FixedWidthReaderTest, ReaderSequenceTest)


def load_tests(loader, tests, pattern):
    """ Define a TestSuite for this module.

    This is part of the unittest API. The last two arguments are ignored. The
    _TEST_CASES global is used to determine which TestCase classes to load
    from this module.

    """
    suite = unittest.TestSuite()
    for test_case in _TEST_CASES:
        tests = loader.loadTestsFromTestCase(test_case)
        suite.addTests(tests)
    return suite


# Make the module executable.

if __name__ == "__main__":
    unittest.main()  # main() calls sys.exit()
Example #4
0
        self.whitelist = TextFilter(regex)
        self.blacklist = TextFilter(regex, False)
        self.data = ["abc\n", "def\n", "ghi\n"]
        return


# Specify the test cases to run for this module (disables automatic discovery).

_TEST_CASES = (FieldFilterTest, TextFilterTest)


def load_tests(loader, tests, pattern):
    """ Define a TestSuite for this module.

    This is part of the unittest API. The last two arguments are ignored. The
    _TEST_CASES global is used to determine which TestCase classes to load
    from this module.

    """
    suite = unittest.TestSuite()
    for test_case in _TEST_CASES:
        tests = loader.loadTestsFromTestCase(test_case)
        suite.addTests(tests)
    return suite


# Make the module executable.

if __name__ == "__main__":
    unittest.main()  # this calls exit()