-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5094839
commit e1a691e
Showing
7 changed files
with
83 additions
and
50 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
File renamed without changes.
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,40 @@ | ||
# Copyright 2021 UW-IT, University of Washington | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from unittest import TestCase | ||
from restclients_core.exceptions import DataFailureException | ||
from uw_space import Facilities | ||
from uw_space.utils import fdao_space_override | ||
|
||
data = { | ||
'code': 'MEB', | ||
'last_updated': '2021-03-27 04:53:09', | ||
'latitude': '47.653693', | ||
'longitude': '-122.304747', | ||
'name': 'Mechanical Engineering Building', | ||
'number': '1347', | ||
'site': 'Seattle Main Campus', | ||
'type': 'Building' | ||
} | ||
|
||
|
||
@fdao_space_override | ||
class TestSpace(TestCase): | ||
def test_search_by_code(self): | ||
fac = Facilities().search_by_code("MEB") | ||
self.assertEqual(len(fac), 1) | ||
self.assertEqual(fac[0].json_data(), data) | ||
|
||
self.assertRaises( | ||
DataFailureException, | ||
Facilities().search_by_code, "None" | ||
) | ||
|
||
def test_search_by_number(self): | ||
fac = Facilities().search_by_number("1347") | ||
self.assertEqual(fac.json_data(), data) | ||
|
||
self.assertRaises( | ||
DataFailureException, | ||
Facilities().search_by_number, "0" | ||
) |
This file was deleted.
Oops, something went wrong.
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