def test_history(test_data): people = People.people() def ned_then(year): ned = people.get("ned", datetime.datetime(year, 1, 1)) return ned['institution'] assert ned_then(2015) == "edX" assert ned_then(2014) == "edX" assert ned_then(2013) == "edX" assert ned_then(2012) == "freelance" assert ned_then(2011) == "freelance" assert ned_then(2010) == "Hewlett Packard" assert ned_then(2009) == "Hewlett Packard" assert ned_then(2008) == "Hewlett Packard" assert ned_then(2007) == "Tabblo" assert ned_then(2006) == "Kubi Software" assert ned_then(2005) == "Kubi Software" assert ned_then(2004) == "Kubi Software" assert ned_then(2003) == "Kubi Software" assert ned_then(2002) == "Kubi Software" assert ned_then(2001) == "Blue Ripple" assert ned_then(2000) == "Blue Ripple"
def test_get_non_person(test_data): people = People.people() ghost = people.get("ghost") assert ghost['institution'] == "unsigned" assert ghost['agreement'] == "none"
def test_get_institution(test_data): people = People.people() assert people.get("ned")['institution'] == "edX" assert people.get("db")['institution'] == "Optimists United"
def test_main_singleton_is_a_singleton(test_data): p1 = People.people() p2 = People.people() assert p1 is p2
def org(self): people = People.people() user_info = people.get(self.user_login, self.created_at) return user_info.get("institution", "other")
def test_main_singleton_is_a_singleton(self): p1 = People.people() p2 = People.people() self.assertIs(p1, p2)