Skip to content

Commit 478b3bd

Browse files
committed
Refactor write operations from local client to fs client
1 parent f176d70 commit 478b3bd

File tree

6 files changed

+309
-199
lines changed

6 files changed

+309
-199
lines changed

arthur_bench/client/fs/abc_fs_client.py

+57-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
import os
12
import uuid
23
from abc import ABC, abstractmethod, abstractstaticmethod
34
from datetime import datetime
45
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
69

710

811
class ABCFSClient(ABC):
912

13+
@abstractmethod
14+
def __init__(self, config):
15+
self.config = config
16+
1017
@abstractmethod
1118
def get_test_suite_dir(self, test_suite_name: str) -> Path:
1219
raise NotImplementedError(
@@ -73,3 +80,52 @@ def update_run_index(self, test_suite_name: str, id: uuid.UUID, name: str) -> No
7380
raise NotImplementedError(
7481
"Calling an abstract method. Please use a concrete base class"
7582
)
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

Comments
 (0)