Created
March 3, 2019 11:42
-
-
Save NMZivkovic/d5c266383ad53ef4efa9149545c9e51d to your computer and use it in GitHub Desktop.
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
import unittest | |
from citadel import Citadel | |
from rick import Rick | |
from morty import Morty | |
class CitadelTests(unittest.TestCase): | |
def test_get_all_residents(self): | |
citadel = Citadel() | |
residents = citadel.get_all_residents() | |
self.assertCountEqual(residents, []) | |
def test_add_resident(self): | |
citadel = Citadel() | |
rick = Rick(111) | |
morty = Morty(111) | |
citadel.add_resident(rick) | |
citadel.add_resident(morty) | |
residents = citadel.get_all_residents() | |
self.assertEqual(residents[0], rick) | |
self.assertEqual(residents[1], morty) | |
def test_picle_ricks_with_morties(self): | |
citadel = Citadel() | |
rick = Rick(111) | |
morty = Morty(111) | |
rick.assign(morty) | |
citadel.add_resident(rick) | |
citadel.add_resident(morty) | |
citadel.picle_ricks_with_morties() | |
residents = citadel.get_all_residents() | |
self.assertTrue(residents[0].is_pickle) | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment