File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ import pytest
2+
3+ from app .services .location import LocationService
4+
5+ class GoodLocationService (LocationService ):
6+ """Valid LocationService Class."""
7+ async def get_all (self ):
8+ """
9+ Gets and returns all of the locations.
10+ """
11+ return [True , True ]
12+
13+ async def get (self , id ): # pylint: disable=redefined-builtin,invalid-name
14+ """
15+ Gets and returns location with the provided id.
16+ """
17+ return id
18+
19+ class BadLocationService (LocationService ):
20+ """Invalid LocationService Class."""
21+ pass
22+
23+
24+ def test_location_service_invalid ():
25+ """Test for location service interface invalid class."""
26+ with pytest .raises (TypeError ):
27+ BadLocationService ()
28+
29+
30+ def test_location_service_invalid ():
31+ """Test for location service interface valid class."""
32+ good_loc_service = GoodLocationService ()
33+ assert all (good_loc_service .get_all ())
34+ assert good_loc_service .get (1 ) == 1
35+
You can’t perform that action at this time.
0 commit comments