-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--------- Co-authored-by: Olivia Brown <oliviabrown@MacBook-Pro-4.localdomain> Co-authored-by: Olivia Brown <oliviabrown@MacBook-Pro-4.local>
- Loading branch information
1 parent
2833d5f
commit 9bd1404
Showing
15 changed files
with
169 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"python.analysis.extraPaths": ["./src/main/py"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,3 @@ test: ruff pylint | |
--top-level-directory . | ||
coverage report | ||
coverage html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,4 +72,3 @@ else | |
pip install -r requirements.txt | ||
fi | ||
fi | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
""" | ||
Module to manage art collections for Art Collectors. | ||
""" | ||
|
||
from commission.artwork import Artwork | ||
|
||
|
||
class ArtCollection: | ||
""" | ||
Class to manage art collections for Art Collectors | ||
""" | ||
|
||
def __init__(self) -> None: | ||
""" | ||
Initialize the art collection by creating an empty list for the artworks | ||
in the collection | ||
""" | ||
self.artworks = [] | ||
|
||
def get_artworks(self): | ||
""" | ||
Returns the artworks in the collection | ||
""" | ||
|
||
return self.artworks | ||
|
||
def add_to_art_collection(self, artwork: Artwork): | ||
""" | ||
Add an artwork to the collection | ||
""" | ||
|
||
self.artworks.append(artwork) | ||
|
||
def remove_from_art_collection(self, artwork: Artwork): | ||
""" | ||
Remove an artwork from the collection | ||
""" | ||
|
||
self.artworks.remove(artwork) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""Test module for ArtCollection class""" | ||
|
||
import unittest | ||
from datetime import timedelta | ||
from commission.artcollection import ArtCollection | ||
from commission.artwork import Artwork | ||
|
||
|
||
class TestArtCollection(unittest.TestCase): | ||
""" | ||
Test class for ArtCollection class | ||
""" | ||
|
||
def setUp(self): | ||
""" | ||
Create an instance of ArtCollection and Artwork | ||
with width=100, height=100, and wait_time=1 day | ||
""" | ||
|
||
self.collection = ArtCollection() | ||
self.artwork1 = Artwork(100.0, 100.0, timedelta(days=1)) | ||
self.artwork2 = Artwork(200.0, 200.0, timedelta(days=2)) | ||
|
||
def test_add_to_art_collection(self): | ||
""" | ||
Test the add_to_art_collection method of ArtCollection | ||
This test verifies that the add_to_art_collection method correctly | ||
""" | ||
|
||
self.collection.add_to_art_collection(self.artwork1) | ||
self.assertIn(self.artwork1, self.collection.get_artworks()) | ||
|
||
def test_remove_from_art_collection(self): | ||
"""Test the remove_from_art_collection method of ArtCollection | ||
This test verifies that the remove_from_art_collection method correctly | ||
and removes an artwork from a collection | ||
""" | ||
|
||
self.collection.add_to_art_collection(self.artwork1) | ||
self.collection.remove_from_art_collection(self.artwork1) | ||
self.assertNotIn(self.artwork1, self.collection.get_artworks()) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters