Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/analyse/analyseur_log_apache.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Module pour l'analyse statistique d'un fichier log Apache.
"""

from os.path import abspath
from collections import Counter
from parse.fichier_log_apache import FichierLogApache
from analyse.filtre_log_apache import FiltreLogApache
Expand Down Expand Up @@ -113,7 +114,7 @@ def get_analyse_complete(self) -> dict:
Retourne l'analyse complète du fichier de log Apache.

L'analyse suit la structure suivante :
- chemin: chemin du fichier
- chemin: chemin absolu du fichier
- total_entrees: voir :meth:`get_total_entrees`
- filtre: filtre appliqué à l'analyse
- statistiques:
Expand All @@ -126,7 +127,7 @@ def get_analyse_complete(self) -> dict:
dict: L'analyse sous forme d'un dictionnaire.
"""
return {
"chemin": self.fichier.chemin,
"chemin": abspath(self.fichier.chemin),
"total_entrees": self.get_total_entrees(),
"filtre": self.filtre.get_dict_filtre(),
"statistiques": {
Expand Down
2 changes: 1 addition & 1 deletion app/cli/parseur_arguments_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def parse_args(self,

if not match(regex_chemin, arguments_parses.sortie):
raise ArgumentCLIException(
"Le chemin du fichier de sortie doit uniquement contenir les caractères "
"Le chemin du dossier de sortie doit uniquement contenir les caractères "
"autorisés. Les caractères autorisés sont les minuscules, majuscules, "
"chiffres ou les caractères spéciaux suivants: _, \\, -, /."
)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_analyseur_log_apache.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import pytest
from os.path import abspath
from parse.fichier_log_apache import FichierLogApache
from analyse.filtre_log_apache import FiltreLogApache
from analyse.analyseur_log_apache import AnalyseurLogApache
Expand Down Expand Up @@ -324,7 +325,7 @@ def test_analyseur_get_analyse_complete_valide(analyseur_log_apache):
de la classe :class:`AnalyseurLogApache`.
"""
analyse = analyseur_log_apache.get_analyse_complete()
assert analyse["chemin"] == analyseur_log_apache.fichier.chemin
assert analyse["chemin"] == abspath(analyseur_log_apache.fichier.chemin)
assert analyse["total_entrees"] == analyseur_log_apache.get_total_entrees()
assert analyse["filtre"] == analyseur_log_apache.filtre.get_dict_filtre()
statistiques = analyse["statistiques"]
Expand Down