Example #1
0
 def test_can_retrieve_valid_index(self):
     past_team = Page('data', DATA)
     one = past_team.get(0)
     self.assertEqual(one.name, "Facebook")
     self.assertEqual(one.permalink, "facebook")
     self.assertEqual(one.api_path, "organizations/facebook")
     self.assertEqual(one.web_path, "organization/facebook")
Example #2
0
 def test_can_retrieve_valid_index(self):
     past_team = Page('data', DATA)
     one = past_team.get(0)
     self.assertEqual(one.name, "Facebook")
     self.assertEqual(one.permalink, "facebook")
     self.assertEqual(one.api_path, "organizations/facebook")
     self.assertEqual(one.web_path, "organization/facebook")
Example #3
0
    def test_passing_in_bad_key(self):
        past_team = Page('data', DATA)
        with self.assertRaises(TypeError):
            past_team['bad']

        self.assertEqual(past_team[0], past_team.get(0))
Example #4
0
 def test_retrieving_out_of_bound_index(self):
     past_team = Page('data', DATA)
     with self.assertRaises(IndexError):
         past_team.get(2)
Example #5
0
 def test_can_retrieve_valid_index(self):
     past_team = Page('data', DATA)
     one = past_team.get(0)
     self.assertEqual(one.name, "Example")
     self.assertEqual(one.permalink, "example")
Example #6
0
 def test_iterate(self):
     past_team = Page('data', DATA)
     members = [member for member in past_team]
     self.assertEqual(1, len(members))
     self.assertEqual(past_team[0], members[0])
Example #7
0
    def test_passing_in_bad_key(self):
        past_team = Page('data', DATA)
        with self.assertRaises(TypeError):
            past_team['bad']

        self.assertEqual(past_team[0], past_team.get(0))
Example #8
0
 def test_retrieving_out_of_bound_index(self):
     past_team = Page('data', DATA)
     with self.assertRaises(IndexError):
         past_team.get(2)
Example #9
0
 def test_can_retrieve_valid_index(self):
     past_team = Page('data', DATA)
     one = past_team.get(0)
     self.assertEqual(one.name, "Example")
     self.assertEqual(one.permalink, "example")