|
| 1 | +import os |
1 | 2 | import uuid
|
2 | 3 | from abc import ABC, abstractmethod, abstractstaticmethod
|
3 | 4 | from datetime import datetime
|
4 | 5 | from pathlib import Path
|
5 |
| -from typing import Optional |
| 6 | +from typing import Optional, Union, List |
| 7 | + |
| 8 | +from arthur_bench.models.models import PaginatedTestSuite, PaginatedRun |
6 | 9 |
|
7 | 10 |
|
8 | 11 | class ABCFSClient(ABC):
|
9 | 12 |
|
| 13 | + @abstractmethod |
| 14 | + def __init__(self, config): |
| 15 | + self.config = config |
| 16 | + |
10 | 17 | @abstractmethod
|
11 | 18 | def get_test_suite_dir(self, test_suite_name: str) -> Path:
|
12 | 19 | raise NotImplementedError(
|
@@ -73,3 +80,52 @@ def update_run_index(self, test_suite_name: str, id: uuid.UUID, name: str) -> No
|
73 | 80 | raise NotImplementedError(
|
74 | 81 | "Calling an abstract method. Please use a concrete base class"
|
75 | 82 | )
|
| 83 | + |
| 84 | + @abstractmethod |
| 85 | + def get_test_suite_by_name(self, test_suite_name: str) -> PaginatedTestSuite: |
| 86 | + raise NotImplementedError( |
| 87 | + "Calling an abstract method. Please use a concrete base class" |
| 88 | + ) |
| 89 | + |
| 90 | + @staticmethod |
| 91 | + @abstractmethod |
| 92 | + def load_suite_with_optional_id(filepath: Union[str, os.PathLike]) -> Optional[PaginatedTestSuite]: |
| 93 | + raise NotImplementedError( |
| 94 | + "Calling an abstract method. Please use a concrete base class" |
| 95 | + ) |
| 96 | + |
| 97 | + @abstractmethod |
| 98 | + def get_suite_files(self) -> List[str]: |
| 99 | + raise NotImplementedError( |
| 100 | + "Calling an abstract method. Please use a concrete base class" |
| 101 | + ) |
| 102 | + |
| 103 | + @abstractmethod |
| 104 | + def get_run_files(self, test_suite_name: str) -> List[str]: |
| 105 | + raise NotImplementedError( |
| 106 | + "Calling an abstract method. Please use a concrete base class" |
| 107 | + ) |
| 108 | + |
| 109 | + @abstractmethod |
| 110 | + def parse_paginated_test_suite(self, id: str) -> PaginatedTestSuite: |
| 111 | + raise NotImplementedError( |
| 112 | + "Calling an abstract method. Please use a concrete base class" |
| 113 | + ) |
| 114 | + |
| 115 | + @abstractmethod |
| 116 | + def parse_paginated_test_run(self, test_suite_id: str, test_run_id: str) -> PaginatedRun: |
| 117 | + raise NotImplementedError( |
| 118 | + "Calling an abstract method. Please use a concrete base class" |
| 119 | + ) |
| 120 | + |
| 121 | + @abstractmethod |
| 122 | + def write_suite_file(self, suite_dir: Path, test_suite: PaginatedTestSuite) -> None: |
| 123 | + raise NotImplementedError( |
| 124 | + "Calling an abstract method. Please use a concrete base class" |
| 125 | + ) |
| 126 | + |
| 127 | + @abstractmethod |
| 128 | + def write_run_file(self, run_dir: Path, test_run: PaginatedRun) -> None: |
| 129 | + raise NotImplementedError( |
| 130 | + "Calling an abstract method. Please use a concrete base class" |
| 131 | + ) |
0 commit comments