Beispiel #1
0
    def test_collecting_tiles_data(self):
        """
        Checks if function get_tiles_configs returns:
            - correct number of tile ids
            - correct number of tile types
            - all required tiles_types and tiles_keys
        """
        tile_types_number = 2  # from data_to_check
        tile_ids_number = 3  # from data_to_check
        data_to_check = (
            ('empty', 'empty'),
            ('text', 'id1'),
            ('text', 'id2'),
        )
        read_data = parser.get_tiles_configs()

        self.assertEqual(
            len(read_data['tiles_names']), tile_types_number,
            'Expected tile_types number: {} found {}'.format(
                tile_types_number, len(read_data['tiles_names'])))
        self.assertEqual(
            len(read_data['tiles_keys']), tile_ids_number,
            'Expected tile_ids number: {} found {}'.format(
                tile_types_number, len(read_data['tiles_names'])))
        for tile_name, tile_key in data_to_check:
            self.assertIn(tile_name, read_data['tiles_names'])
            self.assertIn(tile_key, read_data['tiles_keys'])
Beispiel #2
0
    def test_collecting_tiles_data(self):
        """
        Checks if function get_tiles_configs returns:
            - correct number of tile ids
            - correct number of tile types
            - all required tiles_types and tiles_keys
        """
        tile_types_number = 2  # from data_to_check
        tile_ids_number = 3  # from data_to_check
        data_to_check = (
            ('empty', 'empty'),
            ('text', 'id1'),
            ('text', 'id2'),
        )
        read_data = parser.get_tiles_configs()

        self.assertEqual(
            len(read_data['tiles_names']), tile_types_number,
            'Expected tile_types number: {} found {}'.format(
                tile_types_number, len(read_data['tiles_names'])
            )
        )
        self.assertEqual(
            len(read_data['tiles_keys']), tile_ids_number,
            'Expected tile_ids number: {} found {}'.format(
                tile_types_number, len(read_data['tiles_names'])
            )
        )
        for tile_name, tile_key in data_to_check:
            self.assertIn(tile_name, read_data['tiles_names'])
            self.assertIn(tile_key, read_data['tiles_keys'])
Beispiel #3
0
 def validate_with_config_files(self, post):
     tiles_configs = get_tiles_configs()
     error_msg = self.validate_with_config_file(post, tiles_configs)
     return error_msg
Beispiel #4
0
 def validate_with_config_files(self, post):
     tiles_configs = get_tiles_configs()
     error_msg = self.validate_with_config_file(post, tiles_configs)
     return error_msg