Beispiel #1
0
    def test_list_of_lists_file_parser_floats(self):
        # Arrange
        path_to_test_data = abs_path_to_test_data_file('list_of_lists_file_parser_floats.txt')
        expected = [[1.5,2.5,3.5],[4.5,5.5,6.5]]

        # Act
        result = file_parsers.list_of_lists_file_parser(path_to_test_data, 'FLOAT')

        # Assert
        self.assertEqual(expected, result)
Beispiel #2
0
    def test_list_of_lists_file_parser_ints(self):
        # Arrange
        path_to_test_data = abs_path_to_test_data_file('list_of_lists_file_parser_ints.txt')
        expected = [[1,2,3],[4,5,6]]

        # Act
        result = file_parsers.list_of_lists_file_parser(path_to_test_data, 'INT')

        # Assert
        self.assertEqual(expected, result)
Beispiel #3
0
    def test_list_of_lists_file_parser_strings(self):
        # Arrange
        path_to_test_data = abs_path_to_test_data_file('list_of_lists_file_parser_strings.txt')

        expected = [['hi', 'what\'s', 'up'],
                    ['my', 'name', 'is', 'shay'],
                    ['what', 'is', 'yours?']]

        # Act
        result = file_parsers.list_of_lists_file_parser(path_to_test_data)

        # Assert
        self.assertEqual(expected, result)