-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unittests for location.ParkingLocation (#80)
- Loading branch information
Showing
2 changed files
with
29 additions
and
6 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
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,23 @@ | ||
"""pytest tests for mytoyota.location.ParkingLocation""" | ||
|
||
from mytoyota.location import ParkingLocation | ||
|
||
# pylint: disable=no-self-use | ||
|
||
|
||
class TestParkingLocation: | ||
"""pytest functions to test ParkingLocation""" | ||
|
||
def test_parking_location(self): | ||
"""Test ParkingLocation""" | ||
location = ParkingLocation({"timestamp": 987654, "lat": 1.234, "lon": 5.678}) | ||
assert location.latitude == 1.234 | ||
assert location.longitude == 5.678 | ||
assert location.timestamp == 987654 | ||
|
||
def test_parking_location_no_data(self): | ||
"""Test ParkingLocation with no initialization data""" | ||
location = ParkingLocation({}) | ||
assert location.latitude == 0.0 | ||
assert location.longitude == 0.0 | ||
assert location.timestamp == 0 |