mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
refactor: move remaining test examples to fixture files
This commit is contained in:
parent
4de8c25a3f
commit
642c1c50fb
4 changed files with 66 additions and 68 deletions
25
tests/fixtures/languages/python/test.py
vendored
Normal file
25
tests/fixtures/languages/python/test.py
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
from typing import Optional, List
|
||||
|
||||
class Person:
|
||||
"""A class representing a person."""
|
||||
|
||||
def __init__(self, name: str, age: Optional[int] = None):
|
||||
self.name = name
|
||||
self.age = age
|
||||
|
||||
def greet(self, formal: bool = False) -> str:
|
||||
"""Generate a greeting."""
|
||||
prefix = "Good day" if formal else "Hello"
|
||||
return f"{prefix}, {self.name}!"
|
||||
|
||||
def create_greeting_list(people: List[Person]) -> List[str]:
|
||||
"""Create greetings for a list of people."""
|
||||
return [person.greet() for person in people]
|
||||
|
||||
# Constants
|
||||
DEFAULT_NAME = "World"
|
||||
MAX_AGE = 150
|
||||
|
||||
if __name__ == "__main__":
|
||||
person = Person(DEFAULT_NAME)
|
||||
print(person.greet())
|
Loading…
Add table
Add a link
Reference in a new issue